HTML COURSE โ€ข LESSON 9

HTML Text Formatting

HTML provides special elements for displaying important, emphasized and formatted text.

Common Formatting Elements

Element Purpose
<b> Displays bold text.
<strong> Displays important text.
<i> Displays italic text.
<em> Displays emphasized text.
<mark> Highlights text.
<small> Displays smaller text.
<del> Displays deleted text.
<ins> Displays inserted text.
<sub> Displays subscript text.
<sup> Displays superscript text.

Formatting Example

Text Formatting
<p>
    <b>EDUHUB</b> is an online platform.
</p>

<p>
    <strong>HTML is important!</strong>
</p>

<p>
    <i>Learn web development.</i>
</p>

<p>
    <em>Practice every day.</em>
</p>

<p>
    <mark>Important Note</mark>
</p>

Subscript and Superscript

Subscript and Superscript
<p>
    H<sub>2</sub>O
</p>

<p>
    x<sup>2</sup>
</p>
๐Ÿ’ก Accessibility Tip

Use <strong> and <em> when the text has importance or emphasis. Do not use them only to change the visual appearance.

โšก EDUHUB Live HTML Editor

LIVE PREVIEW