HTML Reference ยท Inline Text
The <b> element
Reference for the HTML <b> element: drawing attention to text without adding importance, how it differs from <strong>, examples and technical details.
The <b> element draws attention to a span of text without saying that it is more important or that it should be read with stress. Typical uses are key words in a summary, product names in a review, or the opening words of an article. Browsers display it in bold.
The name comes from "bold", but in modern HTML the element is defined by its purpose, not its look. If the text truly matters more than the text around it, use <strong> instead.
<p>Add the <b>flour</b>, <b>sugar</b> and <b>butter</b> to a large bowl.</p>
Try it
The product name only needs to stand out, so it uses <b>. The overheating charger is a real warning, so it uses <strong>.
Attributes
This element has no attributes of its own. It accepts the global attributes, such as class, id, lang and title.
Usage notes
- Use it last. Reach for
<b>only when no other element fits. Importance is<strong>, stress is<em>, highlighting for relevance is<mark>, and headings are<h1>โ<h6>. - Add a class. A class such as
class="product"orclass="lead"records why the text is marked and lets you restyle it later. - Not for styling alone. If you just want bold text with no special role, apply
font-weight: boldwith CSS on the element you already have. - Accessibility. Screen readers do not announce
<b>, which matches its meaning: it is a visual cue only. Don't use it for anything a listener must notice.
Technical summary
| Content categories | Flow content, phrasing content, palpable content |
| Permitted content | Phrasing content |
| Tag omission | None; both the start and end tags are required |
| Permitted parents | Any element that accepts phrasing content |
| Implicit ARIA role | generic |
| DOM interface | HTMLElement |
| Default display | inline |
Browser support
Supported in every browser.
Related
<strong>โ strong importance<i>โ text in an alternate voice<mark>โ highlighted for relevance<span>โ a generic inline container- Lesson: Formatting Text