sub ElementThe sub element is an inline element declared by the XHTML 1.1 Presentation Module (Inline Presentation)
Elements in the Presentation Module are:big | small | sub | sup | i | b | tt (Inline Presentation Support Module)hr (Block Presentation Support Module)
The text within a sub element should be subscripted.
For example, the code:
H<sub>2</sub>O
is rendered as follows:
H2O
The same effect can be achieved using CSS using the declaration
vertical-align:sub if you wish to separate content from presentation.
I would generally use the sub tag if the subscripting were a semantic part of the text
(such as the example above) and the CSS if it were desired for purely presentational reasons.
See also the sup element.
There are no #REQUIRED attributes on the sub element.
There are no specific attributes declared on the sub element.
sub element are listed below:class [ type NMTOKENS ]id [ type ID ]style [ type CDATA ], from the Style Attribute Module (deprecated)title [ type Text ]xmlns [ type URI - #FIXED 'http://www.w3.org/1999/xhtml' ]dir [ type Enumeration (ltr | rtl) ], from the Bi-directional Text Modulexml:lang [ type LanguageCode ]All attributes in the
Events Attribute Collection
are supported:onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
sub element is:
( #PCDATA | Inline.mix )*
See Content Model & Nesting for information about Content Model syntax and Nesting Groups.
subabbr, acronym, br, cite, code, dfn, em, kbd, q, samp, span, strong, varabutton, input, label, select, textareaimgb, big, i, small, sub, sup, ttmapnoscript, scriptdel, insbdoobjectrubysubabbr, acronym, address, cite, code, dfn, div, em, h1 - h6, kbd, p, q, samp, span, strong, varadd, dt, licaption, td, thbutton, fieldset, label, legendb, big, i, small, sub, sup, ttdel, insbdoobjectrb, rt