GeoffKnagge.com

Attributes for all document objects

Almost all items within the BODY section of a HTML document support the following attributes. Even if they don't work, it doesn't hurt to include them since they may be supported in the future, and the browser will just ignore it if it's not recognised. For ease of reading, these are not mentioned for each element, but can be assumed :
  • lang="???" : specifies the language of any text. "en" is English, others are described at http://ds.internic.net/rfc/rfc1766.txt.

  • dir="???" is LTR or RTL - it specifies whether text is displayed left-to-right or right-to-left.

  • id="???" allows you to specify a name to an object, for use with links. Supercedes the <a name="???"> tag.

  • class="???": Assigns the object to a class of your choice. For example when the PRE tag is used with style sheets, the following can then be placed in the HEAD part of the document:
    <STYLE type="text/css">
    PRE.[classname] { background : green }
    </STYLE>

  • title="???" : Gives the object a title or description, which is displayed when the mouse pointer rests on an object.
  • style="???" : specifies style sheet information for that tag

  • align="???" : values usually include left, right and center - sets the alignment of the object.

  • tabindex="???" : Available on links, anchors and form elements, the number that you specify determines in what order elements gain the "focus" as the TAB key is repeatedly pressed.

  • accesskey=? : Defines a keyboard character that activates a link or form object.


(C)opyright, Geoff Knagge.
Continued use of this site indicates your agreement to the Conditions of use and Privacy Policy.