D Dev Notebook

HTML5 Text Formatting

HTML

What is Text Formatting in HTML?

.Text formatting in HTML5 means using HTML tags to style or emphasize text on a webpage.

.This helps you make text bold, italic, highlighted, subscript, superscript, etc. to improve readability and convey meaning.

Common HTML5 Text Formatting Tags

TagPurpose Example
<b>Bold text (without importance)Bold
<strong>Strong importance (bold)Important
<i>Italic text (without emphasis)Italic
<em>Emphasized text (italic)Emphasized
<mark>Highlighted textHighlight
<small>Smaller textSmall
<del>Deleted (strikethrough) textOld
<ins>Inserted (underlined) textNew
<sub>SubscriptH2O
<sup>SuperscriptE=mc2
<u>Underlined textUnderline
<abbr>AbbreviationHTML

When to use which?

✅ Use <strong> and <em> for meaning (important for screen readers & SEO).

✅ Use <b> and <i> only for visual styling (no added importance).

✅ Use <mark> to highlight search keywords or important text.

✅ Use <del> and <ins> to show edits or corrections.