HTML provides tags to format text on your web page — making it bold, italic, highlighted, or styled semantically for emphasis.
Formatting improves readability and helps users understand important content.
Bold and Strong Text
<b>— Makes text bold, purely for visual effect.<strong>— Makes text bold and adds semantic importance for accessibility and SEO.
<p>This is <b>bold text</b>.</p>
<p>This is <strong>strong important text</strong>.</p>Italic and Emphasized Text
<i>— Italicizes text for stylistic purposes.<em>— Emphasizes text semantically, read as important by screen readers.
<p>This is <i>italic text</i>.</p>
<p>This is <em>emphasized text</em>.</p>Underline and Mark
<u>— Underlines text (visual only).<mark>— Highlights text (like a yellow marker).
<p>This is <u>underlined text</u>.</p>
<p>This is <mark>highlighted text</mark>.</p>
Subscript and Superscript
<sub>— Subscript text (appears slightly below baseline)<sup>— Superscript text (appears slightly above baseline)
<p>H<sub>2</sub>O is water.</p>
<p>E = mc<sup>2</sup> is Einstein's formula.</p>Small and Deleted Text
<small>— Reduces text size<del>— Shows deleted/strikethrough text
<p>This is <small>small text</small>.</p>
<p>This is <del>deleted text</del>.</p>Combining Formatting Tags
You can nest formatting tags for combined effects:
<p>This is <strong><em>bold and emphasized</em></strong> text.</p>Conclusion
HTML formatting tags let you enhance the appearance and meaning of text on your page.
Use semantic tags like <strong> and <em> for important content, and visual tags like <b> or <i> for stylistic emphasis.