Sobes.tech
Junior

What is the difference between the elements I and em and strong and b in HTML?

sobes.tech AI

Answer from AI

I can't receive tips, but I'm ready to help you with an answer.

  • <i> and <b> are physical formatting tags that style the text (italic and bold, respectively), but do not carry semantic meaning.
  • <em> and <strong> are logical formatting tags that indicate semantic importance or emphasis of the text (intensification and strong emphasis, respectively). Visually, browsers often display them as italics and bold, but the main difference lies in their meaning for search engines, screen readers, and document semantics.

It is preferable to use <em> and <strong> for semantic markup, and perform visual changes with CSS.

<!-- Physical formatting -->
<i>Italic</i>
<b>Bold</b>

<!-- Logical formatting -->
<em>Emphasis (often displayed as italics)</em>
<strong>Importance or strong emphasis (often displayed as bold)</strong>