HTML— Text Formatting/Styling

HTML provides us with a very basic styling of text. Here are some of them:

  • Bold

The first way to do that is using the <b></b> tag which is used for bold.
<b> tag is fine to use but a better (second way) way to make a text bold is by using the <strong> tag which is the same as the <b> tag.

<b>This is bold text.</b>
<strong>This is also bold text.</strong>
Bold/Strong text in HTML
Bold/Strong text in HTML
  • Italic or Tilted

To make text italic use tag <i> or a better way is by using <em> tag which is short for emphasis. Both give us the same results.

<i>This is italic text.</i>
<em>This is also italic text.</em>
Italic/Emphasized text in HTML
Italic/Emphasized text in HTML
  • Underlined

We use the <u> tag for underlining text but a better way to do this is by using the <ins> tag short for inserted. Again same results.

<u>This is underlined text.</u>
<ins>This is also underlined text.</ins>
Underline/Inserted text in HTML
Underline/Inserted text in HTML
  • Superscript (Above the line)

To make text superscript, we use the <sup> tag.

This is <sup>superscript</sup> text.
Superscript text in HTML
Superscript text in HTML
  • Subscript (Below the line)

To make text subscript, we use the <sub> tag.

This is <sub>subscript</sub> text.
Subscript text in HTML
Subscript text in HTML
  • Deleted or Cut

We use <del> tag to get deleted text. We also see a <strike> tag on some websites. Strike tag is not used in HTML 5

<del>This is some deleted text.</del>
<strike>This is also deleted text.</strike>
Delete/Cut text in HTML

Last, this is not text styling but we see in some websites a horizontal line that divides the website into sections. To add such a line we use the <hr> tag which is short for Horizontal Row.

Text Formatting in HTML
Text Formatting in HTML

You can find more text formatting by just googling “Text formatting in HTML”.

Instructor ~ TARUN KUMAR

Lazy Syntax

--

--