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.
| Tag | Effect | Best used for |
|---|---|---|
| <strong> | Bold + important | Text with strong importance |
| <b> | Bold only | Visually bold, no extra meaning |
| <em> | Italic + emphasis | Stressed or emphasized text |
| <i> | Italic only | Foreign words, technical terms |
| <mark> | Yellow highlight | Highlighted content |
| <s> | Strikethrough | No longer relevant content |
| <sub> | Subscript H₂O | Chemical formulas, footnotes |
| <sup> | Superscript x² | Math exponents, ordinals |
| <code> | Monospace code style | Inline code snippets in text |
📝 Edit Code
👁 Live Preview
💡 Tags can be nested — wrap <em> inside <strong> to get bold italic at once.