< Day Day Up > |
This construct encloses text comments that will not be displayed by the browser. No attributes or events are associated with this construct.
<!-- ... -->
<!-- This is an informational comment that can occur anywhere in an HTML document. The next few examples show how style sheets and scripts are "commented out" to prevent older browsers from misinterpreting the content. --> <style type="text/css"> <!-- h1 {color: red; font-size: 40pt;} --> </style> <script type="text/javascript"> <!-- document.write("hello world"); // --> </script>
HTML 2, 3.2, 4, 4.01 | Internet Explorer 2, 3, 4, 5, 5.5, 6 |
Comments often are used to exclude content from older browsers, particularly those that do not understand client-side scripting or style sheets. Page developers should be careful when commenting HTML markup. Older browsers may or may not render the enclosed content.
This SGML construct specifies the document type definition corresponding to the document. There are no attributes or events associated with this element.
<!DOCTYPE "DTD IDENTIFIER">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 TRANSITIONAL//EN"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
HTML 2, 3.2, 4, 4.01 | Internet Explorer 2, 3, 4, 5, 5.5, 6 |
The doctype statement should be used as the first line of all documents.
Validation programs might use this construct when determining the correctness of an HTML document.
Modern browsers may determine what rendering mode to use depending on the doctype statement. This is dubbed the doctype switch . An incorrect doctype that does not correspond to appropriate markup usage may result in inaccurate display.
This element defines a hyperlink, the named target destination for a hyperlink, or both.
<a accesskey="key" charset="character code for language of linked resource" class="class name(s)" coords="comma-separated list of numbers" dir="ltr rtl" href="url" hreflang="language code" id="unique alphanumeric identifier" lang="language code" name="name of target location" rel="comma-separated list of relationship values" rev="comma-separated list of relationship values" shape="default circle poly rect" style="style information" tabindex="number" target="_blank frame-name _parent _self _top" (transitional only) title="advisory text" type="content type of linked data"> </a>
contenteditable="false true inherit" (5.5) datafield="name of column supplying bound data" (4) datasrc="ID of data source object supplying data" (4) disabled="false true" (5.5) hidefocus="true false" (5.5) language="javascript jscript vbs vbscript" (4) methods="http-method" (4) unselectable="off on" (5.5) urn="URN string" (4)
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
onactivate, onbeforeactivate, onbeforecopy, onbeforecut, onbeforedeactivate, onbeforeeditfocus, onbeforepaste, onblur, oncontextmenu, oncontrolselect, oncopy, oncut, ondeactivate, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocus, onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresize, onresizeend, onresizestart, onselectstart, ontimeerror
accesskey This attribute specifies a keyboard navigation accelerator for the element. Pressing ALT or a similar key (depending on the browser and operating system) in association with the specified key selects the anchor element correlated with that key.
charset This attribute defines the character encoding of the linked resource. The value is a space- and/or comma-delimited list of character sets as defined in RFC 2045. The default value is ISO-8859-1 .
coords For use with object shapes , this attribute uses a comma-separated list of numbers to define the coordinates of the object on the page.
datafld This attribute specifies the column name from the data source object that supplies the bound data. This attribute is specific to Microsoft's data binding.
datasrc This attribute indicates the id of the data source object that supplies the data that is bound to this element. This attribute is specific to Microsoft's data binding.
href This is the single required attribute for anchors defining a hypertext source link. It indicates the link target-either a URL or a URL fragment, which is a name preceded by a hash mark (#) specifying an internal target location within the current document. URLs are not restricted
to Web-based (http) documents. URLs might use any protocol supported by the browser. For example, file, ftp, and mailto work in most user agents .
hreflang This attribute is used to indicate the language of the linked resource.
methods The value of this attribute provides information about the functions that might be performed on an object. The values generally are given by the HTTP protocol when it is used, but as for the title attribute, it might be useful to include advisory information in advance in the link. For example, the browser might choose a different rendering of a link as a function of the methods specified; something that is searchable might get a different icon, or an outside link might render with an indication of leaving the current site. This element is not well understood nor supported, even by the defining browser, Internet Explorer.
name This attribute is required in an anchor defining a target location within a page. A value for name is similar to a value for the id core attribute, and it should be an alphanumeric identifier unique to the document. Under the HTML and XHTML specifications, id and name both can be used with an <a> tag as long as they have identical values.
rel For anchors containing the href attribute, this attribute specifies the relationship of the target object to the link object. The value is a comma-separated list of relationship values. The values and their semantics will be registered by some authority that might have meaning to the document author. The default relationship, if no other is given, is void . The rel attribute should be used only when the href attribute is present.
rev This attribute specifies a reverse link, the inverse relationship of the rel attribute. It is useful for indicating where an object came from, such as the author of a document.
shape This attribute is used to define a selectable region for hypertext source links associated with a figure in order to create an image map. The values for the attribute are circle , default , polygon , and rect . The format of the coords attribute depends on the value of shape . For circle , the value is x,y,r, where x and y are the pixel coordinates for the center of the circle and r is the radius value in pixels. For rect , the coords attribute should be x,y,w,h . The x,y values define the upper-left corner of the rectangle, while w and h define the width and height, respectively. A value of polygon for shape requires x1,y1,x2,y2, values for coords . Each of the x,y pairs define a point in the polygon, with successive points being joined by straight lines and the last point joined to the first. The value of default for shape requires that the entire enclosed area, typically an image, be used.
Note | It is advisable to use the usemap attribute for the img element and the associated map element to define hotspots instead of the shape attribute. |
tabindex This attribute uses a number to identify the object's position in the tabbing order for keyboard navigation using the TAB key.
target This attribute specifies the target window for a hypertext source link that references frames . The information linked to target will be displayed in the named window. Frames and inline frames must be named to be targeted .
There are, however, special name values. These include _blank , which indicates a new window; _parent , which indicates the parent frame set containing the source link; _self , which indicates the frame containing the source link; and _top , which indicates the full browser window.
type This attribute specifies the media type in the form of a MIME type for the link target. Generally, this is provided strictly as advisory information; however, in the future a browser might add a small icon for multimedia types. For example, a browser might add a small speaker icon when type is set to audio/wav. For a complete list of recognized MIME types, see http://www.w3.org/TR/html4/references.html#ref-MIMETYPES.
urn This supposedly Microsoft-supported attribute relates a uniform resource name (URN) with the link. While it is based on standards work years back, the meaning of URNs is still not well defined, so this attribute is meaningless.
<!-- anchor linking to external file --> <a href="http://www.democompany.com/">External Link</a> <!-- anchor linking to file on local file system --> <a href="file:/c:\html\index.html">local file link</a> <!-- anchor invoking anonymous FTP --> <a href="ftp://ftp.democompany.com/freestuff">Anonymous FTP link</a> <!-- anchor invoking FTP with password --> <a href="ftp://joeuser:secretpassword@democompany.com/path/file"> FTP with password </a> <!-- anchor invoking mail --> <a href="mailto:fakeid@democompany.com"> Send mail </a> <!-- anchor used to define target destination within document --> <a name="jump"> Jump target </a> <!-- anchor linking internally to previous target anchor --> <a href="#jump">Local jump within document</a> <!-- anchor linking externally to previous target anchor --> <a href="http://www.democompany.com/document#jump"> Remote jump within document</a>
HTML 2, 3.2, 4, 4.01 | Internet Explorer 2, 3, 4, 5, 5.5, 6 |
The following are reserved browser key bindings for the two major browsers and should not be used as values for accesskey : a , c , e , f , g , h , v , left arrow, and right arrow.
HTML 3.2 defines only name , href , rel , rev , and title .
The target attribute is not defined in browsers that do not support frames, such as Netscape 1 generation browsers. Furthermore, target is not allowed under strict variants of XHTML but is limited to frameset or transitional forms.
This element allows authors to clearly indicate a sequence of characters that define an abbreviation for a word (such as Mr. instead of Mister, Calif instead of California).
<abbr class="class name(s)" dir="ltr rtl" id="unique alphanumeric identifier" lang="language code" style="style information" title="advisory text"> </abbr>
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
<abbr title="California abbreviated">Calif </abbr> Isn't <abbr> WWW </abbr> an acronym? Are you sure?
HTML 4, 4.01 | Netscape 6, 7 |
This tag is commonly confused with <acronym> . Debate about just what constitutes an acronym as compared with an abbreviation is common amongst very detail-oriented Web standards experts. In reality, Web developers appear to use the <acronym> tag more often than the <abbr> tag.
With the title attribute set on this element, Opera and Mozilla may render a dotted underline useful to suggest the Tooltip that might contain a definition for the word.
Because there is typically no markup-oriented presentation for this element, it is primarily used in conjunction with style sheets and scripts.
This element allows authors to clearly indicate a sequence of characters that compose an acronym (XML, WWW, and so on).
<acronym class="class name(s)" dir="ltr rtl" id="unique alphanumeric identifier" lang="language code" style="style information" title="advisory text"> </acronym>
accesskey="key" (5.5) contenteditable="false true inherit" (5.5) disabled="false true" (5.5) hidefocus="true false" (5.5) language="javascript jscript vbs vbscript" (4) tabindex="number" (5.5) unselectable="off on" (5.5)
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
onactivate, onbeforedeactivate, onbeforeeditfocus, onblur, oncontrolselect, ondeactivate, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocus, onmouseenter, onmouseleave, onmove, onmoveend, onmovestart, onreadystatechange, onresizeend, onresizestart, onselectstart, ontimeerror
<acronym title="Extensible Markup Language">XML</acronym> <acronym lang="fr" title="Société Nationale de Chemins de Fer"> SNCF </acronym>
HTML 4, 4.01 | Internet Explorer 4, 5, 5.5, 6 |
<acronym> is a new element that is not defined under HTML 2 or 3.2.
This tag is often confused with <abbr> .
With the title attribute set on this element, Opera and Mozilla may render a dotted underline to suggest the Tooltip that might contain a definition for the word.
This element marks up text indicating authorship or ownership of information. It generally occurs at the beginning or end of a document.
<address class="class name(s)" dir="ltr rtl" id="unique alphanumeric identifier" lang="language code" style="style information" title="advisory text"> </address>
accesskey="key" (5.5) contenteditable="inherit false true" (5.5) disabled="false true" (5.5) hidefocus="true false" (5.5) language="javascript jscript vbs sbscript" (4) tabindex="number" (5.5) unselectable="off on" (5.5)
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
onactivate, onbeforeactivate, onbeforecopy, onbeforecut, onbeforedeactivate, onbeforeeditfocus, onbeforepaste, onblur, oncontextmenu, oncontrolselect, oncopy, oncut, ondeactivate, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocus, onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresize, onresizeend, onresizestart, onselectstart, ontimeerror
<address >Big Company, Inc. <br /> 2105 Demo Street <br /> San Diego, CA 92109 U.S.A. </address >
HTML 2, 3.2, 4, 4.01 | Internet Explorer 2, 3, 4, 5, 5.5, 6 |
Under HTML 2.0 and 3.2, there are no attributes for <address> .
This element identifies the inclusion of a Java applet. The strict HTML 4.01 definition does not include this element; it has been deprecated in favor of <object> .
<applet align="bottom left middle right top" alt="alternative text" archive="URL of archive file" class="class name(s)" code="URL of Java class file" codebase="URL for base referencing" height="pixels" hspace="pixels" id="unique alphanumeric identifier" name="unique name for scripting reference" object="filename" style="style information" title="advisory text" vspace="pixels" width="pixels"> </applet>
accesskey="key" (5.5) datafld="name of column supplying bound data" (4) datasrc="ID of data source object supplying data" (4) hidefocus="true false" (5.5) src="URL" (4) tabindex="number" (5.5) unselectable="off on" (5.5)
mayscript (4)
onactivate, onbeforeactivate, onbeforecut, onbeforedeactivate, onbeforeeditfocus, onbeforepaste, onblur, oncontextmenu, oncontrolselect, oncut, ondataavailable, ondatasetchanged, ondatasetcomplete, ondeactivate, onfocus, onfocusin, onfocusout, onhelp, onkeypress, onload, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresize, onresizeend, onresizestart, onrowenter, onrowexit, onrowsdelete, onrowsinserted, onscroll
align This attribute is used to position the applet on the page relative to content that might flow around it. The transitional specifications define values of bottom , left , middle , right , and top , whereas Microsoft and Netscape also might support absbottom , absmiddle , baseline , center , and texttop .
alt This attribute causes a descriptive text alternative to be displayed in browsers that do not support Java. Page designers should also remember that content enclosed within an <applet> tag may also be rendered as alternative text.
archive This attribute refers to an archived or compressed version of the applet and its associated class files, which might help reduce download time.
code This attribute specifies the URL of the applet's class file to be loaded and executed. Applet filenames are identified by a .class filename extension. The URL specified by code might be relative to the codebase attribute.
codebase This attribute gives the absolute or relative URL of the directory where applets' .class files referenced by the code attribute are stored.
datafld This attribute, supported by Internet Explorer 4 and higher, specifies the column name from the data source object that supplies the bound data. This attribute might be used to specify the various <param> tags passed to the Java applet.
datasrc Like datafld , this attribute is used for data binding under Internet Explorer 4. It indicates the id of the data source object that supplies the data that is bound to the <param> tags associated with the applet.
height This attribute specifies the height, in pixels, that the applet needs.
hspace This attribute specifies additional horizontal space, in pixels, to be reserved on either side of the applet.
mayscript In the Netscape implementation, this attribute allows access to an applet by programs in a scripting language embedded in the document.
name This attribute assigns a name to the applet so that it can be identified by other resources, particularly scripts.
object This attribute specifies the URL of a serialized representation of an applet.
src As defined for Internet Explorer 4 and higher, this attribute specifies a URL for an associated file for the applet. The meaning and use is unclear and not part of the HTML standard.
vspace This attribute specifies additional vertical space, in pixels, to be reserved above and below the applet.
width This attribute specifies the width, in pixels, that the applet needs.
<applet code="game.class" align="left" archive="game.zip" height="250" width="350"> <param name="difficulty" value="easy"> <b> Sorry, you need Java to play this game. </b> </applet>
HTML 2, 3.2, 4, 4.01 (transitional) | Internet Explorer 4, 5, 5.5, 6 |
The W3C specification does not encourage the use of <applet> and prefers the use of the <object> tag. Under the strict definition of HTML 4.01, this element is deprecated.
Defines a hot-spot region on an image, and associates it with a hypertext link. This element is used only within a <map> tag.
<area accesskey="character" alt="alternative text" class="class name(s)" coords="comma separated list of values" dir="ltr rtl" href="url" id="unique alphanumeric identifier" lang="language code" nohref="nohref" shape="circle default poly rect" style="style information" tabindex="number" target="_blank frame-name _parent _self _top" (transitional or frameset only) title="advisory text" />
language="javascript jscript vbs vbscript" (4) hidefocus="true false" (5.5) unselectable="off on" (5.5)
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
onactivate, onbeforeactivate, onbeforecopy, onbeforecut, onbeforedeactivate, onbeforeeditfocus, onbeforepaste, onblur, oncontextmenu, oncontrolselect, oncopy, oncut, ondeactivate, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocus, onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresizeend, onresizestart, onselectstart, ontimeerror
accesskey This attribute specifies a keyboard navigation accelerator for the element. Pressing ALT or a similar key in association with the specified character selects the form control correlated with that key sequence. Page designers are forewarned to avoid key sequences already bound to browsers.
alt This attribute contains a text string alternative to display on browsers that cannot display images.
coords This attribute contains a set of values specifying the coordinates of the hot-spot region. The number and meaning of the values depend upon the value specified for the shape attribute. For a rect or rectangle shape, the coords value is two x,y pairs: left , top , right , and bottom . For a circ or circle shape, the coords value is x,y,r where x,y is a pair specifying the center of the circle and r is a value for the radius. For a poly or polygon shape, the coords value is a set of x,y pairs for each point in the polygon: x1,y1,x2,y2,x3,y3, and so on.
href This attribute specifies the hyperlink target for the area. Its value is a valid URL. Either this attribute or the nohref attribute must be present in the element.
name This attribute is used to define a name for the clickable area so that it can be scripted by older browsers.
nohref This attribute indicates that no hyperlink exists for the associated area. Either this attribute or the href attribute must be present in the element.
shape This attribute defines the shape of the associated hot spot. HTML 4 defines the values rect , which defines a rectangular region; circle , which defines a circular region; poly , which defines a polygon; and default , which indicates the entire region beyond any defined shapes. Many browsers, notably Internet Explorer 4 and higher, support circ , polygon , and rectangle as valid values for shape .
tabindex This attribute uses a numeric value to specify the position of the defined area in the browser tabbing order.
target This attribute specifies the target window for hyperlink referencing frames. The value is a frame name or one of several special names . A value of _blank indicates a new window. A value of _parent indicates the parent frame set containing the source link. A value of _self indicates the frame containing the source link. A value of _top indicates the full browser window.
<map name="primary"> <area shape="circle" coords="200,250,25" href="another.html" /> <area shape="default" nohref="nohref" /> </map>
HTML 2, 3.2, 4, 4.01 | Internet Explorer 2, 3, 4, 5, 5.5, 6 |
Under the HTML 3.2 and 4.0 specifications, the closing tag </area> is forbidden.
The XHTML 1.0 specification requires a trailing slash: <area /> .
The id , class , and style attributes have the same meaning as the core attributes defined in the HTML 4 specification, but only Netscape and Microsoft define them.
Netscape 1-level browsers do not understand the target attribute as it relates to frames.
HTML 3.2 defines only alt , coords , href , nohref , and shape .
This element indicates that the enclosed text should be displayed in boldface.
<b class="class name(s)" dir="ltr rtl" id="unique alphanumeric identifier" lang="language code" style="style information" title="advisory text"> </b>
accesskey="key" (5.5) contenteditable="false true inherit" (5.5) disabled="false true" (5.5) hidefocus="true false" (5.5) language="javascript jscript vbs vbscript" (4) tabindex="number" (5.5) unselectable="off on" (5.5)
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
onactivate, onbeforeactivate, onbeforecopy, onbeforecut, onbeforedeactivate, onbeforeeditfocus, onbeforepaste, onblur, oncontextmenu, oncontrolselect, oncopy, oncut, ondeactivate, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocus, onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresizeend, onresizestart, onselectstart, ontimeerror
This text is <b> bold </b> for emphasis.
HTML 2, 3.2, 4, 4.01 | Internet Explorer 2, 3, 4, 5, 5.5, 6 |
HTML 2 and 3.2 do not define any attributes for this element.
This element specifies the base URL to be used for all relative URLs contained within a document.
<base href="url" id="unique alphanumeric identifier" target="_blank frame-name _parent _self top" (transitional only) />
onlayoutcomplete, onmouseenter, onmouseleave, onreadystatechange
href This attribute specifies the base URL to be used throughout the document for relative URL addresses.
target For documents containing frames, this attribute specifies the default target window for every link that does not have an explicit target reference. Aside from named frames, several special values exist. A value of _blank indicates a new window. A value of _parent indicates the parent frame set containing the source link. A value of _self indicates the frame containing the source link. A value of _top indicates the full browser window.
<base href="http://www.democompany.com/" /> <base target="_blank" href="http://www.democompany.com/" />
HTML 2, 3.2, 4, 4.01 | Internet Explorer 2, 3, 4, 5, 5.5, 6 |
This element should only occur within the head element.
HTML 2.0 and 3.2 define only the href attribute.
XHTML 1.0 requires a trailing slash: <base /> .
This element establishes a default font size for a document. Font size then can be varied relative to the base font size using the font element.
<basefont color="color name #RRGGBB" face="font name(s)" id="unique alphanumeric identifier" size="1-7 +/-int" />
onlayoutcomplete, onmouseenter, onmouseleave, onreadystatechange
color This attribute sets the text color using either a named color or a color specified in the hexadecimal #RRGGBB format.
face This attribute contains a list of one or more font names. The document text in the default style is rendered in the first font face that the client's browser supports. If no font listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system.
size This attribute specifies the font size as either a numeric or relative value. Numeric values range from 1 to 7 with 1 being the smallest and 3 the default.
<basefont color="#ff0000" face="Helvetica" size="+2" />
HTML 2, 3.2, 4, 4.01 (transitional) | Internet Explorer 2, 3, 4, 5, 5.5, 6 |
HTML 3.2 supports the basefont element but only with the size attribute.
The strict HTML and XHTML specifications do not support this element.
Despite being part of transitional standards, some standards-focused browsers like Mozilla and Opera do not support this element.
This element can be imitated with a CSS rule on the body element.
XHTML 1.0 requires a trailing slash for this element: <basefont /> .
< Day Day Up > |