Skip to the workspace
Pebellslearn by building
Text Content  ›  Lesson

mark, sub and sup

mark 12 minmark highlights text that is relevant in the current context, while sub and sup lower or raise characters whose position is part of their meaning, as in chemical formulas and exponents.

html / mark, sub and sup

Explore each scene at your own pace.

01 · The rule

The rule

mark, sub and sup

mark highlights text that is relevant in the current context, while sub and sup lower or raise characters whose position is part of their meaning, as in chemical formulas and exponents.

Mark relevance and meaningful subscript or superscript without using them as layout tricks.

A few elements exist for very specific jobs: highlighting a match, writing a chemical formula, showing an exponent or a footnote number. They are small, but using them correctly makes text precise instead of approximate.

The rule

mark shows relevance right now; sub and sup move characters that mean something.

<mark> highlights text because it is relevant in the current context, like a highlighter pen on a printed page. The classic use is showing search matches:

<p>Results for "monsoon": The <mark>monsoon</mark> reaches Kerala in early June.</p>

mark is not "important" (that is strong) and not "stressed" (that is em). It says "look here, this is what you are after".

<sub> lowers text below the baseline: subscript. <sup> raises it: superscript. Use them when the position is part of the meaning.

<p>Water is H<sub>2</sub>O.</p>
<p>The area is 25 m<sup>2</sup>.</p>
<p>E = mc<sup>2</sup></p>
<p>This claim needs checking.<sup><a href="#note-1">1</a></sup></p>

Without sub, "H2O" would be a different, looser notation. Without sup, "m2" does not mean square metres to a careful reader. Footnote markers are also commonly written with sup.

Do not use sub or sup just to make text smaller or shift it for decoration; that is a job for CSS.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.