Contents:
HTML Tag and Attribute Descriptions
This section lists the known HTML tags and attributes currently available for use in Web documents. There are many different browsers out there, and they do not all support the same set of tags.
If keeping track of all the browsers and all their differences makes your head spin, no fear. Netscape Navigator and Microsoft's Internet Explorer are the two most popular browsers, and are responsible for almost all of the non-standard extensions to HTML. Chapter 8, Browser Comparison, discusses the most important differences between the latest versions of these two browsers.
The most recent version of Netscape Navigator is 3.0. Tags and attributes specific to this browser have N3 at the beginning of their descriptions. Microsoft's Internet Explorer is also currently at version 3.0. It will be indicated by IE3. Browser-specific tags for the earlier versions of the browsers (e.g., IE2 or N2) are assumed to be supported in the later versions.
Create a hyperlink (href attribute) or fragment identifier (name attribute) within a document.
Specify the URL of a hyperlink target (required if not a name anchor).
Specify a comma-separated list of browser-dependent presentation methods.
Specify the name of a fragment identifier (required if not a hypertext reference anchor).
Indicate the relationship from this document to the target.
Indicate the reverse relationship of the target to this document.
Define the name of the frame or window to receive the referenced document.
Provide a title for the target document.
Specify the location-independent Uniform Resource Name for this hyperlink.
To create an anchor named info at some point in a document called doc.html, use the <a> tag with the name attribute:
<a name="info">Information</a>
To provide a hyperlink to that point in doc.html, use the <a> tag with the href attribute appending the anchor name to the filename using a hash mark (#):
<a href="doc.html#info">Link to information</a>
The enclosed text is an address.
Define an executable applet within a text flow.
Align the <applet> region to either the top, middle, bottom (default), left, right, absmiddle, baseline, or absbottom of the text in the line.
Specify alternative text to replace the <applet> region within browsers that support the <applet> tag, but cannot execute the application.
Specify the class name of the code to be executed (required).
URL from which the code is retrieved.
Specify the height, in pixels, of the <applet> region.
Specify additional space, in pixels, to the left and right of the <applet> region.
Specify the name of this particular instance of the <applet>.
Specify additional space, in pixels, above and below the <applet> region.
Specify the width, in pixels, of the <applet> region.
Define a mouse-sensitive area in a client-side image map.
Specify a comma-separated list of shape-dependent coordinates that define the edge of this area.
Specify the URL of a hyperlink target associated with this area.
Indicate that no document is associated with this area; clicking in the area has no effect.
Define the region's shape to be either circ, circle, poly, polygon, rect, or rectangle.
Format the enclosed text using a bold typeface.
Specify the base URL for all relative URLs in this document.
Specify the base URL.
Define the default target window of all <a> links in the document. Mostly used for redirecting a link to other frames. There are four special values: _blank, _parent, _self, and _top. These values are described in Chapter 4, Frames.
Specify the font size for subsequent text.
IE2 and later. Define background audio for the document.
Set the number of times to play the audio; value may be an integer or the value infinite.
Provide the URL of the audio file to be played.
Format the enclosed text using a bigger typeface.
The enclosed text is a block quotation.
Delimit the beginning and end of the document body.
Set the color of active hypertext links in the document.
Specify the URL of an image to be tiled in the document background.
Set the background color of the document.
IE2 and later. When set to fixed, prevent the background image from scrolling with the document content.
IE2 and later. Set the size, in pixels, of the document's left margin.
Set the color of unvisited hypertext links in the document.
Set the color of regular text in the document.
IE2 and later. Set the size, in pixels, of the document's top margin.
Set the color of visited links in the document.
Break the current text flow, resuming at the beginning of the next line.
Break the flow and move downward until the desired margin, either left, right, or all, is clear.
Define a caption for a table.
For Netscape, set the vertical position of the caption to either top or bottom. Default is top, centered. For Internet Explorer, set the horizontal alignment of the caption to either left, center, or right, or even the vertical position to top or bottom. The default is top, centered. You cannot set both the horizontal and vertical position with this attribute alone. See Chapter 8, Browser Comparison, for more information.
IE2 and later. Set the vertical position of the caption to either top or bottom. Default is top. Use this with a horizontal specification to align to set both vertical and horizontal caption position in Internet Explorer.
See Chapter 5, Tables, for more information on using tables.
Center the enclosed text.
The enclosed text is a citation.
The enclosed text is a code sample.
IE2 and later. Set properties for a column (or columns) within a <colgroup> of a table.
Specify alignment of text in the cells of a column. Value can be center, left, or right.
Specify the number of columns to be affected by the <col> settings.
IE2 and later. Set properties for designated column or columns within a table Also indicates where vertical rules will be drawn when rules=groups is set in the <table> tag.
Specify alignment of text in the cells of columns in the <colgroup>. Values can be center, left, or right.
Specify the number of columns in the <colgroup>.
IE2 and later. Place a comment in the document. Comments will be visible in all other browsers. Comments can be placed within <!- - comment text - -> for all browsers.
Define the definition portion of an element in a definition list.
Format the enclosed text as a definition.
Create a directory list containing <li> tags.
Create a division within a document.
Create a definition list containing <dt> and <dd> tags.
Define the definition term portion of an element in a definition list.
Format the enclosed text with additional emphasis.
Embed an object into a document. Additional parameters to those listed here may be included depending on the embedded object.
Specify the URL of the object to be embedded (required).
Specify the height of the area the embedded object will occupy.
Specify the name of the embedded object.
Specify the width of the area the embedded object will occupy.
Set the size, color, or typeface of the enclosed text.
Set the color of the enclosed text. text"
Set the typeface of the enclosed text to the first available font in the comma-separated list of font names.
Set the size to an absolute value (1 to 7), or relative to the <basefont> size using +n or -n.
Delimit a form.
Specify the URL of the application that will process the form. The default is the current URL.
Specify how the form element values will be encoded.
Specify the parameter-passing style, either get or post The default is get.
IE3 only. Specify a target window for results of form submission to be loaded. The special attributes _bottom, _top, _parent, and _self may be used. They are described in Chapter 4, Frames.
See Chapter 10, HTML Form Tags, for more information on using forms.
Define a frame within a frameset.
N3 only. Set color for frame border if border is turned on with frameborder=yes.
IE3 only. Enable or disable the displaying of a 3-D border for a frame. Default is 1, which inserts the border. The value 0 turns the border off.
N3 only. Enable or disable the displaying of a 3-D border for a frame or a plain border. The default is yes (for 3-D borders).
Place n pixels of space above and below the frame contents.
Place n pixels of space to the left and right of the frame contents.
Define the name of the frame.
Disable user resizing of the frame.
Always add scrollbars (yes), never add scrollbars (no), or add scrollbars when needed (auto).
Define the URL of the source document for this frame.
See Chapter 4, Frames for more information on using frames.
Define a collection of frames or other framesets.
N3 only. Set size in pixels of frame borders within a frameset. Default border width is 5 pixels.
N3 only. Set color for frame borders in a frameset.
Specify the number and width of frames within a frameset.
N3 only. Enable or disable the displaying of 3-D borders or regular borders for frames. The default is yes (3-D borders).
IE3 only. Enable or disable the displaying of 3-D borders for frames within a frameset. The default is 1 (borders on).
IE3 only. Add additional space between adjacent frames in pixels.
Specify the number and height of frames within a frameset.
See Chapter 4, Frames for more information on using frames.
The enclosed text is a level n header; for level n from 1 to 6.
Delimit the beginning and end of the document head.
Break the current text flow and insert a horizontal rule.
Specify the rule alignment as either left, center (default), or right.
Do not use 3-D shading to render the rule.
Set the thickness of the rule to an integer number of pixels.
Set the width of the rule to either an integer number of pixels or a percentage of the page width.
Delimit the beginning and end of the entire HTML document.
Format the enclosed text in an italic typeface.
IE3 only. Define a floating frame within a document with similar placement to <img>. This element requires a closing tag.
Align the floating frame to either the top, middle, bottom (default), left, or right of the text in the line.
Enable or disable the displaying of a 3-D border for a frame. Default is 1, which inserts the border. The value 0 turns the border off.
Specify the height of the frame in pixels or as a percentage of the window size.
Specify the space, in pixels, to be added to the left and right of the image.
Place n pixels of space above and below the frame contents.
Place n pixels of space to the left and right of the frame contents.
Define the name of the frame.
Disable user resizing of the frame.
Always add scrollbars (yes), never add scrollbars (no), or add scrollbars when needed (auto).
Define the URL of the source document for this frame.
Specify the vertical space, in pixels, added at the top and bottom of the image.
Specify the width of the frame in pixels or as a percentage of the window size.
See Chapter 4, Frames for more information on using frames.
Insert an image into the current text flow.
Provide alternative text for non-image-capable browsers.
Set the pixel thickness of the border around images contained within hyperlinks.
IE2 and later. Add playback controls for embedded video clips.
IE2 and later. Specify the URL of a video clip to be displayed.
Specify the height of the image in pixels.
Specify the space, in pixels, to be added to the left and right of the image.
Indicate that the image is mouse-selectable when used within an <a> tag.
IE2 and later. Set the number of times to play the video; value may be an integer or the value infinite.
N2 and later. Specify a low-resolution image to be loaded by the browser first, followed by the image specified by the <src> attribute.
Specify the source URL of the image to be displayed (required).
IE2 and later. Specify when to play the video clip, either fileopen or mouseover.
Specify the map of coordinates and links that define the hypertext links within this image.
Specify the vertical space, in pixels, added at the top and bottom of the image.
Specify the width of the image in pixels.
Create a checkbox input element within a <form>.
Mark the element as initially selected.
Specify the name of the parameter to be passed to the form-processing application if the input element is selected (required).
Specify the value of the parameter sent to the form-processing application if this form element is selected (required).
See Chapter 10, HTML Form Tags, for more information on using forms.
Create a file-selection element within a <form>.
Specify the maximum number of characters to accept for this element.
Specify the name of the parameter that is passed to the form-processing application for this input element (required).
Specify the number of characters to display for this element.
See Chapter 10, HTML Form Tags for more information on using forms.
Create a hidden element within a <form>.
Specify the maximum number of characters to accept for this element.
Specify the name of the parameter that is passed to the form-processing application for this input element (required).
Specify the number of characters to display for this element.
Specify the value of this element that is passed to the form-processing application.
See Chapter 10, HTML Form Tags for more information on using forms.
Create an image input element within a <form>.
Align the image to either the top, middle, or bottom of the form element's text.
Specify the name of the parameter to be passed to the form-processing application for this input element (required).
Specify the source URL of the image (required).
See Chapter 10, HTML Form Tags for more information on using forms.
Create a content-protected text-input element within a <form>.
Specify the maximum number of characters to accept for this element.
Specify the name of the parameter to be passed to the form-processing application for this input element (required).
Specify the number of characters to display for this element.
Specify the initial value for this element.
See Chapter 10, HTML Form Tags for more information on using forms.
Create a radio-button input element within a <form>.
Mark the element as initially selected.
Specify the name of the parameter that is passed to the form-processing application if this input element is selected (required).
Specify the value of the parameter that is passed to the form-processing application if this element is selected (required).
See Chapter 10, HTML Form Tags for more information on using forms.
Create a reset button within a <form>.
Specify an alternate label for the reset button.
See Chapter 10, HTML Form Tags for more information on using forms.
Create a submit button within a <form>.
Specify the name of the parameter that is passed to the form-processing application for this input element (required).
Specify an alternate label for the submit button, as well as the value passed to the form-processing application for this parameter if this button is clicked.
See Chapter 10, HTML Form Tags for more information on using forms.
Create a text input element within a <form>. (This is the default input type.)
Specify the maximum number of characters to accept for this element.
Specify the name of the parameter that is passed to the form-processing application for this input element (required).
Specify the number of characters to display for this element.
Specify the initial value for this element.
See Chapter 10, HTML Form Tags for more information on using forms.
Create a "searchable" HTML document.
IE2 and later. Provide the URL of the program that will perform the searching action.
Provide an alternate prompt for the input field.
The enclosed text is keyboard-like input.
Delimit a list item in an ordered (<ol>) or unordered (<ul>) list.
Set the type of this list element to the desired format. For <li> within <ol>: A (capital letters), a (lowercase letters), I (capital Roman numerals), i (lowercase Roman numerals), or 1 (Arabic numerals; default). For <li> within <ul>: circle, disc (default), or square.
Set the number for this list item to n.
Define a link in the document <head> between this document and another document.
Specify the hypertext reference URL of the target document.
Specify a browser-dependent list of comma-separated display methods for this link.
Indicate the relationship from this document to the target. For Internet Explorer 3.0, rel=style indicates the existence of an external style sheet.
Indicate the reverse relationship from the target to this document.
IE3 only. Specify the URL for the external style sheet to be used in formatting the document.
Provide a title for the target document.
IE3 only. Show type of outside link to be an external cascading style sheet.
Provide the location-independent Uniform Resource Name for the target document.
Same as <pre width=132> ... </pre>; deprecated: don't use.
Define a map containing hotspots in a client-side image map.
IE2 and later. Create a scrolling-text marquee.
Align the marquee to the top, middle, or bottom of the surrounding text.
Define marquee style to be scroll, slide, or alternate.
Set the background color of the marquee.
Define the direction, left or right, the text is to scroll.
Define the height, in pixels, of the marquee area.
Define the space, in pixels, to be inserted left and right of the marquee.
Set the number of times to animate the marquee; value is an integer or infinite.
Set the number of pixels to move the text for each scroll movement.
Specify the delay, in milliseconds, between successive movements of the marquee text.
Define the space, in pixels, to be inserted above and below the marquee.
Define the width, in pixels, of the marquee area.
Provides additional information about a document.
Specify the value for the meta-information (required). For client pulls, content="n;url=url" tells the browser to load the specified url after n seconds. If no URL is specified, the source document will be reloaded. Must be used with http-equiv="refresh" within <meta>.
Specify the HTTP equivalent name for the meta-information and cause the server to include the name and content in the HTTP header for this document when it is transmitted to the client. A value of refresh creates a "client-pull" within a document.
Specify the name of the meta-information.
N3 only. Format enclosed HTML and text in multicolumn format. Text and elements will flow across specified number of columns to give them approximately equal length.
Specify number of columns (required).
Specify amount of space in pixels between columns. Default is 10 pixels.
Specify width of columns in pixels.
Define the labeling start point for automatic document-generation tools.
No breaks allowed in the enclosed text.
Define content to be presented by browsers that do not support frames.
See Chapter 4, Frames for more information on using frames.
N3 only. Specify alternative content for browsers that do not support JavaScript. See Chapter 21, JavaScript Quick Reference, for more information on JavaScript.
IE3 only. Insert an object into the document. This tag is used to specify applets, OLE controls, and other media objects.
Specify how the object is aligned with other elements in the document. Values include: baseline, center, left, middle, right, textbottom, textmiddle, and texttop.
Set the width of the object's border if it is a hyperlink.
Identify the class identifier of the object. The URL syntax of the URL depends on the object type.
Identify the URL of the object's codebase. The syntax of the URL depends on the object.
Specify the media type of the code.
Specify the URL of the data used for the object. The syntax of the URL depends on the object.
Declare an object without instantiating it.
Specify the height of the object in pixels.
Specify the amount of space in pixels between the sides of the object and the surrounding elements.
Specify the name of the object.
Indicate shaped hyperlinks in object.
Specify message to display during object loading.
Specify the media type for data.
Specify image map to use with object.
Specify the amount of space in pixels above and below object.
Specify object width.
Define an ordered list containing numbered (ascending) <li> elements.
Present the list in a more compact manner.
Start numbering the list at n, instead of 1.
Set the numbering format for this list to either A (capital letters), a (lowercase letters), I (capital Roman numerals), i