HTML Text Formatting
HTML provides special tags to format text in different ways. Here is a simple explanation of each:
1. Bold & Important Text
<b> makes text bold. <strong> makes text important.
<p>This is <b>bold</b> text.</p> <p>This is <strong>important</strong> text.</p>
This is bold text.
This is important text.
2. Italic & Emphasized Text
<i> makes text italic. <em> emphasizes text.
<p>This is <i>italic</i> text.</p> <p>This is <em>emphasized</em> text.</p>
This is italic text.
This is emphasized text.
3. Underline, Highlight & Small Text
<u> underlines text. <mark> highlights text. <small> makes text smaller.
<p>This is <u>underlined</u> text.</p> <p>This is <mark>highlighted</mark> text.</p> <p>This is <small>small</small> text.</p>
This is underlined text.
This is highlighted text.
This is small text.
4. Deleted & Inserted Text
<del> shows deleted text. <ins> shows inserted text.
<p>This is <del>deleted</del> text.</p> <p>This is <ins>inserted</ins> text.</p>
This is deleted text.
This is inserted text.
5. Subscript & Superscript
<sub> shows subscript text. <sup> shows superscript text.
<p>H<sub>2</sub>O is water.</p> <p>E = mc<sup>2</sup></p>
H2O is water.
E = mc2
Next Lesson → HTML Quotations & Special Elements
Previous Lesson → HTML Style Attribute