Global Attributes

Although most element attributes tend to be unique to the element, some are almost universal and usable with any element. Table 3.1 summarizes these attributes, showing which elements do take the attributes and how each attribute is used.

Table 3.1. Global XHTML Attributes
Attribute Purpose Used With
class Space-separated list of classes of the element All elements except <base />, <head>, <html>, <meta />, <param />, <script>, <style>, and <title>.
dir Direction for weak or neutral text All elements except <base />, <br />, <frame>, <frameset>, <hr />, <iframe>, <param />, and <script>.
id Unique, document-wide identifier All elements except <base />, <head>, <html>, <meta />, <script>, <style>, and <title>.
lang Specifies ...

Get Platinum Edition Using XHTML™, XML, and Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.