!-- (HTML comment) | !DOCTYPE | a | abbr | acronym | address | applet | area | b | base | basefont | bdo | big | blockquote | body | br | button | caption | center | cite | code | col | colgroup | dd | del | dfn | dir | div | dl | dt | em | fieldset | font | form | frame | frameset | h1 | h2 | h3 | h4 | h5 | h6 | head | hr | html | i | iframe | img | input | ins | isindex | kbd | label | legend | li | link | map | menu | meta | noframes | noscript | object | ol | optgroup | option | p | param | pre | q | s | samp | script | select | small | span | strike | strong | style | sub | sup | table | tbody | td | textarea | tfoot | th | thead | title | tr | tt | u | ul | var
This page discusses features common to many of the HTML tags. Also included is the syntax I used in listing the HTML tags.
Here are general syntax rules that apply to all the tags:
- Most of the tags have the same syntax. Notable exceptions the above syntax includes the structural SGML tags. Here are the two basic syntaxes:
<TagName> ContentEnclosedByTags </TagName> <TagName />
- Each tag may have one or more attributes whose values may be set. EG:
- Each tag may have one or more intrinsic events that can set for detection. EG:
<b onmouseover="DoThis()">Show Me</b>
- Each attribute or intrinsic event may have one or more properties whose values may be set. EG:
<p style="font-size:5; color:#990000;">
- There are several simple rules to make an HTML document a well formed XHTML document. These should be followed as much as possible in case the document is ever translated to an XHTML document.
- ACCESSKEY. Indicates a letter that can be used as a keyboard shortcut to put focus on the tag. This is typically
ALT+AccessKeyfor PCs and
CTRL+AccessKeyfor Macs. For Windows, the presence of an HTML accesskey takes precedence of application access keys. EG: If you put in an HTML accesskey of "h", then it is accessed by pressing "ALT+h" and the application's help menu is accessed by pressing "ALT" then "h". Applies to the following elements: a, area, button, input, label, legend, and textarea.
- CLASS. A list of classes affecting the element. Applies to all elements except for: base, basefont, head, html, meta, param, script, style, and title.
- DIR. The direction the text is read, i.e. either
- DISABLED. Indicates a disabled control. Applies to the following tags: button, input, optgroup, option, select, and textarea.
- ID. An identifier for the element, unique on the page. Applies to all elements except for: base, head, html, meta, script, style, and title.
- NAME. Usually identifies the item in question. The ID attribute is usually much clearer.
- LANG. Identifies the ISO language used. See also my section on Language. Applies to all elements except for: applet, base, basefont, br, frame, frameset, iframe, param, and script.
- STYLE. Inline CSS application. Applies to all elements except for: base, basefont, head, html, meta, param, script, style, and title.
- TABINDEX. A number between 0 and 32767 which indicates the position of the current item in the tabbing order. This attribute applies to the following tags: a, area, button, input, object, select, and textarea.
- TARGET. The name of the frame where a document will be opened. This is is used by <a>, <link>, <area>, and <form>. The following frame names are reserved and have special meaning:
_blank. The browser should load the designated document in a new, unnamed window.
_self. The default. The browser should load the document in the same frame as the element that refers to this target.
_parent. The browser should load the document into the immediate FRAMESET parent of the current frame. This value is equivalent to
_selfif the current frame has no parent.
_top. The browser should load the document into the full, original window (thus canceling all other frames). This value is equivalent to
_selfif the current frame has no parent.
- TITLE. Information about the element. This not to be confused with the <title> tag which is for the whole document. The value of TITLE is commonly rendered as a "tool tip" (a message that pops up when the cursor is held over an object) or as audio (for audio browsers). Applies to all elements except for: base, basefont, head, html, meta, param, script, and title.
- TYPE. This has different meanings depending on the tag!
- VALUE. This has different meanings depending on the tag!
- onkeydown. Pressed and held.
- onkeyup. Pressed, held, and released.
- onmousedown. Pressed and held.
- onmouseup. Pressed, held, and released.
- onmouseover. Move cursor on to an object.
- onmousemove. Move cursor.
- onmouseout. Move cursor off an object.
13 / FF
8 / FP
Note that there are 93 of the three types of tags because the <isindex> tag is both a SL and BL tag, and the <script> tag is both a SL and TL tag.
Here is the syntax I used in listing the HTML tags:
[StartTag/EndTag][EE ][XX][FP]. [Description. ][TagGroup.]
- OO. Optional.
- FF. Forbidden.
- EE. Empty.
- XX. Deprecated.
- LD. Loose DTD,
- FD. Frameset DTD.
- FP. Not directly supported by Microsoft FrontPage.
- SL. Structural Level.
- BL. Block Level
- TL. Text Level.
A DTD (Document Type Definition) is a document that defines an SGML compliant markup language. See also the SGML <!doctype> tag. Here are the three DTDs that are used in defining HTML 4.01:
- Strict DTD. Formal HTML 4.01 without any deprecated tags.
- Loose DTD, aka Transitional DTD. This is Strict DTD plus some of the tags that are deprecated.
- Frameset DTD. This is Loose DTD but with the <body> tag replaced by the <frameset> tag.