HTML: the b element
The <b> element draws attention to text without saying that the text is more important than the surrounding content.
What you will learn
- How to draw attention to a keyword or label with
<b> - How it differs from
<strong>,<em>, and CSS - How to choose markup based on meaning and accessibility, not only appearance
Draw attention to a keyword
<p>Use the <b>Preview</b> command to check the result.</p>
The b element marks text that deserves attention but does not represent a warning, priority, or stress emphasis. Its default appearance is often bold, but the meaning should guide the choice.
Choose the element by meaning
<b>: attention without extra importance.<strong>: strong importance, seriousness, or urgency.<em>: stress emphasis that changes the intended reading.- CSS: visual styling when the text has no special semantic role.
<p><strong>Warning:</strong> Save your work first.</p>
<p>The word <b>Preview</b> names a command.</p>
<p>I said <em>now</em>, not later.</p>
Common mistakes
- Using
<b>for every piece of bold text without considering its role. - Using
<strong>only because it looks bold. - Using
<b>for a warning that should be marked as important. - Using visual styling to communicate information that is unavailable to non-visual users.