<b>

  • Revision slug: HTML/Element/b
  • Revision title: <b>
  • Revision id: 331659
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

Summary

The HTML <b> Element represents a span of text stylistically different from normal text, without a conveying any special importance or relevance. It is typically used for keywords in a summary, product names in a review, or other spans of text whose typical presentation would be boldfaced. Another example of its use is to mark the lead sentence of each paragraph of an article.

Usage notes:

  • Do not confuse the <b> element with the {{ HTMLElement("strong") }}, {{ HTMLElement("em") }}, or {{ HTMLElement("mark") }} elements. The {{ HTMLElement("strong") }} element represents text of certain importance, {{ HTMLElement("em") }} puts some emphasis on the text and the {{ HTMLElement("mark") }} element represents text of certain relevance. The <b> element doesn't convey such special semantic information; use it only when no others fit.
  • Similarly, do not mark titles and headings using the <b> element. For this purpose, use the {{ HTMLElement("h1") }} to {{ HTMLElement("h6") }} tags. Further, stylesheets can change the default style of these elements, with the result that they are not necessarily displayed in bold.
  • It is a good practice to use the class attribute on the <b> in order to convey additional semantic information (for example <b class="lede"> for the first sentence in a paragraph). This eases the development of several stylings of a web document, without the need to change its HTML code.
  • Historically, the <b> element was meant to make text boldface. Styling information has been deprecated since HTML4, so the meaning of the <b> element has been changed.
  • If there is no semantic purpose on using the <b> element, using css property font-weight with bold value would be a better choice for making text bold.

Attributes

Like all other HTML elements, this element has the global attributes.

Example

<p>
  This article describes several <b>text-level</b> elements. It explains their usage in an <b>HTML</b> document.   
</p>
Keywords are displayed with the default style of the <b> element, likely in bold.

Result

This article describes several text-level elements. It explains their usage in an HTML document.

Keywords are displayed with the default style of the <b> element, likely in bold.

Specifications

Specification Status Comment
{{ SpecName('HTML WHATWG', 'text-level-semantics.html#the-b-element', '<b>') }} {{ Spec2('HTML WHATWG') }}  
{{ SpecName('HTML5 W3C', 'the-b-element.html#the-b-element', '<b>') }} {{ Spec2('HTML5 W3C') }}  
{{ SpecName('HTML4.01', 'present/graphics.html#h-15.2.1', '<b>') }} {{ Spec2('HTML4.01') }}  

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{ CompatVersionUnknown() }} {{ CompatGeckoDesktop("1.0") }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }}
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{ CompatVersionUnknown() }} {{ CompatGeckoMobile("1.0") }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }}

See also

  • Others elements conveying text-level semantics: {{ HTMLElement("a") }}, {{ HTMLElement("em") }}, {{ HTMLElement("strong") }}, {{ HTMLElement("small") }}, {{ HTMLElement("cite") }}, {{ HTMLElement("q") }}, {{ HTMLElement("dfn") }}, {{ HTMLElement("abbr") }}, {{ HTMLElement("time") }}, {{ HTMLElement("code") }}, {{ HTMLElement("var") }}, {{ HTMLElement("samp") }}, {{ HTMLElement("kbd") }}, {{ HTMLElement("sub") }}, {{ HTMLElement("sup") }}, {{ HTMLElement("i") }}, {{ HTMLElement("mark") }}, {{ HTMLElement("ruby") }}, {{ HTMLElement("rp") }}, {{ HTMLElement("rt") }}, {{ HTMLElement("bdo") }}, {{ HTMLElement("span") }}, {{ HTMLElement("br") }}, {{ HTMLElement("wbr") }}.
  • Using <b> and <i> elements (W3C)
{{ HTML:Element_Navigation() }}

Revision Source

<h2 id="Summary">Summary</h2>
<p>The <em>HTML <code>&lt;b&gt;</code> Element</em> represents a span of text stylistically different from normal text, without a conveying any special importance or relevance. It is typically used for keywords in a summary, product names in a review, or other spans of text whose typical presentation would be boldfaced. Another example of its use is to mark the lead sentence of each paragraph of an article.</p>
<div class="note">
  <p><strong>Usage notes:</strong></p>
  <ul>
    <li>Do not confuse the <code>&lt;b&gt;</code> element with the {{ HTMLElement("strong") }}, {{ HTMLElement("em") }}, or {{ HTMLElement("mark") }} elements. The {{ HTMLElement("strong") }} element represents text of certain <em>importance</em>, {{ HTMLElement("em") }} puts some emphasis on the text and the {{ HTMLElement("mark") }} element represents text of certain <em>relevance</em>. The <code>&lt;b&gt;</code> element doesn't convey such special semantic information; use it only when no others fit.</li>
    <li>Similarly, do not mark titles and headings using the <code>&lt;b&gt;</code> element. For this purpose, use the {{ HTMLElement("h1") }} to {{ HTMLElement("h6") }} tags. Further, stylesheets can change the default style of these elements, with the result that they are not <em>necessaril</em><em>y</em><em> </em>displayed in bold.</li>
    <li>It is a good practice to use the <strong>class</strong> attribute on the <code>&lt;b&gt;</code> in order to convey additional semantic information (for example <code>&lt;b class="lede"&gt;</code> for the first sentence in a paragraph). This eases the development of several stylings of a web document, without the need to change its HTML code.</li>
    <li>Historically, the <code>&lt;b&gt;</code> element was meant to make text boldface. Styling information has been deprecated since HTML4, so the meaning of the <code>&lt;b&gt;</code> element has been changed.</li>
    <li>If there is no semantic purpose on using the &lt;b&gt; element, using css property <a href="/en-US/docs/CSS/font-weight" title="font-weight">font-weight</a> with bold value would be a better choice for making text bold.</li>
  </ul>
</div>
<ul class="htmlelt">
  <li><dfn><a href="/en-US/docs/HTML/Content_categories" title="/en-US/docs/HTML/Content_categories">Content categories</a></dfn> <a href="/en-US/docs/HTML/Content_categories#flow_content" title="HTML/Content categories#flow content">Flow content</a>, <a href="/en-US/docs/HTML/Content_categories#phrasing_content" title="HTML/Content categories#phrasing content">phrasing content</a>, palpape content.</li>
  <li><dfn>Permitted content</dfn> <a href="/en-US/docs/HTML/Content_categories#Phrasing_content" title="en-US/docs/HTML/Content_categories#Phrasing_content">Phrasing content</a>.</li>
  <li><dfn>Tag omission</dfn> {{ no_tag_omission() }}</li>
  <li><dfn>Permitted parent elements</dfn> Any element that accepts <a href="/en-US/docs/HTML/Content_categories#Phrasing_content" title="en-US/docs/HTML/Content_categories#Phrasing_content">phrasing content</a>.</li>
  <li><dfn>DOM interface</dfn> {{ domxref("HTMLElement")}} Up to Gecko 1.9.2 (Firefox 4) inclusive, Firefox implements the <a href="/en-US/docs/DOM/span" title="DOM/span"><span style="font-family: Courier New;">HTMLSpanElement</span></a> interface for this element.</li>
</ul>
<h2 id="Attributes">Attributes</h2>
<p>Like all other HTML elements, this element has the <a href="/en-US/docs/HTML/Global_attributes" title="HTML/Global attributes">global attributes</a>.</p>
<h2 id="Example">Example</h2>
<pre class="brush: html">
&lt;p&gt;
  This article describes several &lt;b&gt;text-level&lt;/b&gt; elements. It explains their usage in an &lt;b&gt;HTML&lt;/b&gt; document.   
&lt;/p&gt;
Keywords are displayed with the default style of the &lt;b&gt; element, likely in bold.
</pre>
<h3 id="Result">Result</h3>
<p>This article describes several <strong>text-level</strong> elements. It explains their usage in an <strong>HTML</strong> document.</p>
<p>Keywords are displayed with the default style of the &lt;b&gt; element, likely in bold.</p>
<h2 id="Specifications" name="Specifications">Specifications</h2>
<table class="standard-table">
  <thead>
    <tr>
      <th scope="col">Specification</th>
      <th scope="col">Status</th>
      <th scope="col">Comment</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{ SpecName('HTML WHATWG', 'text-level-semantics.html#the-b-element', '&lt;b&gt;') }}</td>
      <td>{{ Spec2('HTML WHATWG') }}</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>{{ SpecName('HTML5 W3C', 'the-b-element.html#the-b-element', '&lt;b&gt;') }}</td>
      <td>{{ Spec2('HTML5 W3C') }}</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>{{ SpecName('HTML4.01', 'present/graphics.html#h-15.2.1', '&lt;b&gt;') }}</td>
      <td>{{ Spec2('HTML4.01') }}</td>
      <td>&nbsp;</td>
    </tr>
  </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatVersionUnknown() }}</td>
        <td>{{ CompatGeckoDesktop("1.0") }}</td>
        <td>{{ CompatVersionUnknown() }}</td>
        <td>{{ CompatVersionUnknown() }}</td>
        <td>{{ CompatVersionUnknown() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE Mobile</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatVersionUnknown() }}</td>
        <td>{{ CompatGeckoMobile("1.0") }}</td>
        <td>{{ CompatVersionUnknown() }}</td>
        <td>{{ CompatVersionUnknown() }}</td>
        <td>{{ CompatVersionUnknown() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<h2 id="See_also">See also</h2>
<ul>
  <li>Others elements conveying <a href="/en-US/docs/HTML/Text_level_semantics_conveying_elements" title="HTML/Text level semantics conveying elements">text-level semantics</a>: {{ HTMLElement("a") }}, {{ HTMLElement("em") }}, {{ HTMLElement("strong") }}, {{ HTMLElement("small") }}, {{ HTMLElement("cite") }}, {{ HTMLElement("q") }}, {{ HTMLElement("dfn") }}, {{ HTMLElement("abbr") }}, {{ HTMLElement("time") }}, {{ HTMLElement("code") }}, {{ HTMLElement("var") }}, {{ HTMLElement("samp") }}, {{ HTMLElement("kbd") }}, {{ HTMLElement("sub") }}, {{ HTMLElement("sup") }}, {{ HTMLElement("i") }}, {{ HTMLElement("mark") }}, {{ HTMLElement("ruby") }}, {{ HTMLElement("rp") }}, {{ HTMLElement("rt") }}, {{ HTMLElement("bdo") }}, {{ HTMLElement("span") }}, {{ HTMLElement("br") }}, {{ HTMLElement("wbr") }}.</li>
  <li><a class="external" href="http://www.w3.org/International/questions/qa-b-and-i-tags">Using &lt;b&gt; and &lt;i&gt; elements (W3C)</a></li>
</ul>
<div>
  {{ HTML:Element_Navigation() }}</div>
<!-- languages( { "de": "de/HTML/Element/b", "pl": "pl/HTML/Element/b", "nl": "nl/HTML/Element/b" } ) -->
Revert to this revision