Day 74 of 100DaysOfSpec, sup, sub, i, b, and u elements
I am reading and taking notes on the HTML specifications for 100 days as part of #The100DayProject. Read the initial intent/backstory. I am a Microsoft employee but all opinions, comments, etc on this site are my own. I do not speak on behalf of my employer, and thus no comments should be taken as representative of Microsoft's official opinion of the spec. Subsections not listed below were read without comment.
Currently reading in 4.5 Text-level semantics.
This whole section of elements has such unsatisfyingly short names, ha.
4.5.16 The sub and sup elements
“The sup
element represents a superscript and the sub
element represents a subscript.”
To be used semantically, not stylistically. Examples are abbreviations in some languages, or mathematical expressions (exponents are what jumps to mind). Not mentioned by the spec, but labels corresponding to footnotes are a common and seemingly-appropriate use of sup
.
4.5.17 The i element
“The i
element represents a span of text in an alternate voice or mood, or otherwise offset from the normal prose in a manner indicating a different quality of text…”
Examples they give of “different” text:
-
Taxonomic designation (“the majestic otter, lutra lutra”)
-
Technical term
-
Idiom from another language
-
Transliteration
-
Internal thought (as in a novel)
-
Ship name in “Western” text
-
If the
i
element contains text in another language, you should mark that language using thelang
attribute. -
There are some overlaps with element eligibility where you might want to go with another element:
em
for stressing emphasis,dfn
for defining a term. -
It’s curious that the spec just assumes you know that the
i
element is associated with italics. It’s not until the end of this section that it mentions thei
element can be italicized but doesn’t necessarily need to be. And it doesn’t mention in non-normative text that browsers will typically apply italics.
4.5.18 The b element
“The b element represents a span of text to which attention is being drawn for utilitarian purposes without conveying any extra importance and with no implication of an alternate voice or mood…”
- As the
b
element is so semantically vague and basically just a shortcut to styling, the spec encourages authors to find a more appropriately-semantic element where possible. - Same note as
i
, thatb
is not necessarily bold.
4.5.19 The u element
“The u
element represents a span of text with an unarticulated, though explicitly rendered, non-textual annotation, such as labeling the text as being a proper name in Chinese text (a Chinese proper name mark), or labeling the text as being misspelt.”
That was not really the description I was expecting. The spec suggests different elements you can use in lieu of the u
element in different cases because “authors are encouraged to avoid using the u element where it could be confused for a hyperlink”.