SyntaxStudy
Sign Up
HTML Beginner 5 min read

Bold and Italic Text

Bold and Italic Text

HTML provides both visual and semantic elements for emphasising text. <strong> renders text bold and carries semantic weight — screen readers may announce it with emphasis. <b> also makes text bold but is purely presentational with no extra meaning.

Italic and Emphasis

Similarly, <em> italicises text and signals stress emphasis, while <i> is purely visual. Use <em> and <strong> when the emphasis is meaningful; use <b> and <i> for stylistic uses like technical terms, foreign phrases, or titles.

  • <strong> — Important (semantic bold)
  • <b> — Bold (presentational)
  • <em> — Stressed emphasis (semantic italic)
  • <i> — Italic (presentational)
Example
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Bold and Italic</title>
</head>
<body>
  <p>This is <strong>very important</strong> information.</p>
  <p>This is <b>bold</b> for visual style only.</p>

  <p>Please <em>do not</em> ignore this warning.</p>
  <p>The term <i>Lorem Ipsum</i> is Latin placeholder text.</p>

  <!-- Combining -->  
  <p>This is <strong><em>critically important</em></strong>.</p>

  <!-- Other inline elements -->
  <p>The price is <del>$20</del> now <ins>$15</ins>.</p>
  <p>H<sub>2</sub>O and E=mc<sup>2</sup></p>
</body>
</html>
Pro Tip

Prefer <strong> over <b> and <em> over <i> wherever the emphasis carries meaning — this improves accessibility for screen reader users.