Text Formatting

All HTML topics
∙ Chapter 07

Text Formatting

HTML has built-in tags to make text bold, italic, highlighted, strikethrough and more — each tag carries a specific meaning.

TagEffectBest used for
<strong>Bold + importantText with strong importance
<b>Bold onlyVisually bold, no extra meaning
<em>Italic + emphasisStressed or emphasized text
<i>Italic onlyForeign words, technical terms
<mark>Yellow highlightHighlighted content
<s>StrikethroughNo longer relevant content
<sub>Subscript H₂OChemical formulas, footnotes
<sup>Superscript x²Math exponents, ordinals
<code>Monospace code styleInline code snippets in text
formatting.php
📝 Edit Code
👁 Live Preview
💡 Tags can be nested — wrap <em> inside <strong> to get bold italic at once.