<b>

Draws attention to a piece of text without giving it any extra weight, e.g. keywords.

Display
inline
Closing tag
Required
Permitted content
Phrasing content
On this page

Example

#
HTML
<p><b>The new React course is now available.</b> It includes 30 lessons and 5 portfolio projects.</p>
<p>In this module you'll learn <b>variables</b>, <b>conditionals</b>, and <b>loops</b>, the three pillars of every program.</p>
Preview

Definition and usage

#

The <b> element marks text you want to draw the reader’s attention to, even though it isn’t more important than the rest: keywords in a summary, product names in a review, or an article’s opening sentence. Browsers display it in bold.

Treat it as a last resort. If the text is genuinely important, use <strong>. If it’s about stress, use <em>, and mark a defined term with <dfn>. When you just need bold text with no meaning attached, CSS is the better choice: font-weight: bold.

The name comes from bold, but in modern HTML what matters is meaning, not appearance. That’s why <b> is still a valid element, just with a narrower use than it once had.

Syntax

#
Syntax
<b>eye-catching text</b>

Attributes

#

This element has no attributes of its own. It supports the global attributes, such as class, id and hidden.

Default CSS

#

Most browsers display this element with these default styles:

CSS
b {
  font-weight: bold;
}

Browser support

#

Widely available

Works in all modern browsers, phones included. You can use it without worry.

  • Chrome
  • Edge
  • Firefox
  • Safari

Good practices

#
  • Mark importance with <strong>, and leave <b> for catching the eye.
  • Don’t use <b> instead of a heading. A section title is <h2>, <h3>, and so on.
  • If the bold styling is purely decorative, set it in CSS.

Related entries

#

Spotted a mistake or missing an example? Write to us.