devnotes.

Text Formatting Tags (Bold, Italic, and More)

HTML provides several inline tags for emphasizing or styling text within a paragraph, without breaking the flow of the sentence.

<p><strong>This text is important.</strong></p>
<p><em>This text is emphasized.</em></p>
<p><b>Bold with no special meaning.</b></p>
<p><i>Italic with no special meaning.</i></p>
<p><mark>Highlighted text</mark></p>
<p><small>Fine print text</small></p>
<p><del>Removed text</del> <ins>Newly added text</ins></p>
<p>Water is H<sub>2</sub>O, and 5<sup>2</sup> equals 25.</p>

An important distinction: <strong> and <em> carry semantic meaning<strong> means "this is important," and <em> means "this should be stressed when read aloud." Screen readers change their tone for these tags. <b> and <i> only change the visual appearance (bold/italic) without implying any meaning — use them only for things like a book title or a keyword that has no added importance, where <strong>/<em> wouldn't be semantically accurate.

<mark> highlights text (like a highlighter pen), <small> is used for fine print/disclaimers, <del> and <ins> show tracked edits, and <sub>/<sup> handle subscript and superscript — useful for chemical formulas, footnotes, and exponents.