HTML Formatting
HTML contains several elements for defining text with a special meaning.
HTML Text Formatting
HTML has many elements for defining text with special meanings. Formatting elements were designed to display special types of text.
Try It — All Formatting Elements
Preview
What Each Tag Does
| Tag | Meaning | Output |
|---|---|---|
<b> | Bold (no extra importance) | bold |
<strong> | Bold + semantically important | important |
<i> | Italic (alternate voice) | italic |
<em> | Italic + emphasized | emphasized |
<mark> | Highlighted text | highlighted |
<small> | Smaller than surrounding text | smaller |
<del> | Strikethrough (deleted) | |
<ins> | Underlined (inserted/added) | inserted |
<sub> | Subscript (lower) | H₂O |
<sup> | Superscript (raised) | x² |
Tip: Prefer
<strong>over<b>and<em>over<i>— they carry meaningful semantic weight that helps screen readers and search engines.