<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
Example
#<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>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
#<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:
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
#- <strong> vs <b><strong> marks content that is important, urgent or serious. <b> only draws attention to a piece of text, without adding any weight. Visually, both are bold.
- <strong>Text of great importance: a warning, key information.
- <em>Stress in a sentence: a word that, read aloud, is pronounced with emphasis.
- <i>Text in a different tone or voice: foreign expressions, Latin names, a character’s thoughts, technical terms.
- <mark>Highlights a piece of text like a highlighter, because it’s relevant in the current context.
- <span>A generic inline container with no meaning, for styling a piece of text.
Spotted a mistake or missing an example? Write to us.