From the course: HTML Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Superscripts, subscripts, and small text

Superscripts, subscripts, and small text - HTML Tutorial

From the course: HTML Essential Training

Start my 1-month free trial

Superscripts, subscripts, and small text

- Let's talk about another situation where you need to mark up certain bits of content as having a different meaning than the rest. Subscripts, superscripts, and small text. Subscripts are characters that are set below the normal baseline for text. Did you ever take a chemistry class and learn how to write the formula for water, H2O, where the two is lowered down than the H and the O? The two character is typeset as a subscript. It's set lower down. Superscripts are characters that are set above the normal baseline of text. Mathematical formulas have lots of superscripts, like five squared. Or in footnotes, the little marker for a footnote is a superscript. To mark up subscripts and superscripts, we'll use the sub and sup elements. H2O looks wrong like this. I'll wrap the two in its sub-element, and now it drops down below the baseline and gets a little smaller. Next, let's format this number for the footnote.…

Contents