Core Attributes
In addition to element-type-specific attributes (such as the
cite attribute used for blockquotes), the
following core attributes may also be applied across almost the
entire range of HTML elements, with some exceptions where it is not
relevant to the contents of that element. For example the title
attribute may be used on all elements contained in the body of a document (and can be
applied to the body element itself) but is not relevant
to the majority of elements found inside the head of the document, e.g.
base, script and (perhaps not
surprisingly) the title
elements. Similarly, dir is a
core attribute used for specifying the reading direction of text and is
therefore not valid for elements such as applet, br, or param.
In this Section
- id
a unique identifier for this element in the document - class
classifies this element into one or more subtypes - dir
specifies the reading direction for text as left to right or right to left - lang
specifies the language of this element’s content along with the language of any attribute content (for example, that inside the title attribute) - style
specifies an inline style for this element - title
provides extra information about the element - xml:lang
specifies the language of the content inside this element in XHTML documents