Geek Slack

Start creating your course and become a part of GeekSlack.

Introduction to HTML
About Lesson



HTML Text Formatting


HTML Text Formatting

HTML provides several tags to format text and change the appearance of content. These tags include elements for bold, italic, underline, and more.

Common Text Formatting Elements

  • <b> – Bold text
  • <strong> – Important text
  • <i> – Italic text
  • <em> – Emphasized text
  • <u> – Underlined text
  • <s> – Strikethrough text
  • <mark> – Marked text
  • <small> – Smaller text
  • <del> – Deleted text
  • <ins> – Inserted text
  • <sub> – Subscript text
  • <sup> – Superscript text

Examples

<p>This is <b>bold</b> text.</p>
<p>This is <strong>important</strong> text.</p>
<p>This is <i>italic</i> text.</p>
<p>This is <em>emphasized</em> text.</p>
<p>This is <u>underlined</u> text.</p>
<p>This is <s>strikethrough</s> text.</p>
<p>This is <mark>marked</mark> text.</p>
<p>This is <small>smaller</small> text.</p>
<p>This is <del>deleted</del> text.</p>
<p>This is <ins>inserted</ins> text.</p>
<p>This is <sub>subscript</sub> text.</p>
<p>This is <sup>superscript</sup> text.</p>

Rendering of Text Formatting

This is bold text.

This is important text.

This is italic text.

This is emphasized text.

This is underlined text.

This is strikethrough text.

This is marked text.

This is smaller text.

This is deleted text.

This is inserted text.

This is subscript text.

This is superscript text.

Usage Tips

  • Use <b> and <strong> to make text bold, with <strong> also conveying importance.
  • Use <i> and <em> to italicize text, with <em> also conveying emphasis.
  • Use <u> to underline text sparingly, as it can be confused with hyperlinks.
  • Use <s> for strikethrough text to indicate something is incorrect or no longer relevant.
  • Use <mark> to highlight text.
  • Use <small> to display text in a smaller font size.
  • Use <del> and <ins> to show deleted and inserted text, respectively, often used in revision tracking.
  • Use <sub> and <sup> for subscript and superscript text, respectively, often used in mathematical and chemical formulas.

Join the conversation