HTML: Subscript formatting

This entry is part 6 of 34 in the series HTML

Subscript makes text smaller and moves it below the baseline.

The most common use for subscript is in chemical formulas such as H2SO4.

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>Subscript Formatting</title>
</head>
<body>

<H2>H<sub>2</sub>O is actually water</H2>

</body>
</html>

HTML: Applying superscript formatting

This entry is part 5 of 34 in the series HTML

Superscript formatting makes text smaller and raises it off the baseline.

We have typically used superscript to format exponents in math equations such as x2 +1.

<!DOCTYPE html>
<html>
<head lang='en'>
    <meta charset='UTF-8'>
    <title>Superscript Formatting</title>
</head>
<body>

<H3>Pub Happy Hours: 5pm to 9pm<sup>1</sup></H3>
<br>
<p><sup>1</sup>Closed on Monday.</p>

</body>
</html>

As you can see in the example, superscript is formatted by using <sup> tag.