summaryrefslogtreecommitdiff
path: root/devdocs/html/element%2Fb.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/html/element%2Fb.html
new repository
Diffstat (limited to 'devdocs/html/element%2Fb.html')
-rw-r--r--devdocs/html/element%2Fb.html78
1 files changed, 78 insertions, 0 deletions
diff --git a/devdocs/html/element%2Fb.html b/devdocs/html/element%2Fb.html
new file mode 100644
index 00000000..f900c341
--- /dev/null
+++ b/devdocs/html/element%2Fb.html
@@ -0,0 +1,78 @@
+<header><h1>&lt;b&gt;: The Bring Attention To element</h1></header><div class="section-content"><p>The <code>&lt;b&gt;</code> <a href="../index">HTML</a> element is used to draw the reader's attention to the element's contents, which are not otherwise granted special importance. This was formerly known as the Boldface element, and most browsers still draw the text in boldface. However, you should not use <code>&lt;b&gt;</code> for styling text or granting importance. If you wish to create boldface text, you should use the CSS <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight"><code>font-weight</code></a> property. If you wish to indicate an element is of special importance, you should use the <a href="strong"><code>&lt;strong&gt;</code></a> element.</p></div>
+<h2 id="try_it">Try it</h2>
+<div class="section-content"><iframe class="interactive is-tabbed-shorter-height" height="200" src="https://interactive-examples.mdn.mozilla.net/pages/tabbed/b.html" title="MDN Web Docs Interactive Example" loading="lazy"></iframe></div>
+<h2 id="attributes">Attributes</h2>
+<div class="section-content"><p>This element only includes the <a href="../global_attributes">global attributes</a>.</p></div>
+<h2 id="usage_notes">Usage notes</h2>
+<div class="section-content"><ul> <li>Use the <code>&lt;b&gt;</code> for cases like keywords in a summary, product names in a review, or other spans of text whose typical presentation would be boldfaced (but not including any special importance).</li> <li>Do not confuse the <code>&lt;b&gt;</code> element with the <a href="strong"><code>&lt;strong&gt;</code></a>, <a href="em"><code>&lt;em&gt;</code></a>, or <a href="mark"><code>&lt;mark&gt;</code></a> elements. The <a href="strong"><code>&lt;strong&gt;</code></a> element represents text of certain <em>importance</em>, <a href="em"><code>&lt;em&gt;</code></a> puts some emphasis on the text and the <a href="mark"><code>&lt;mark&gt;</code></a> 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 <a href="heading_elements">h1</a> to <a href="heading_elements">h6</a> tags. Further, stylesheets can change the default style of these elements, with the result that they are not <em>necessarily</em> displayed in bold.</li> <li>It is a good practice to use the <a href="../global_attributes#class"><code>class</code></a> attribute on the <code>&lt;b&gt;</code> element in order to convey additional semantic information as needed (for example <code>&lt;b class="lead"&gt;</code> for the first sentence in a paragraph). This makes it easier to manage multiple use cases of <code>&lt;b&gt;</code> if your stylistic needs change, without the need to change all of its uses in the HTML.</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 to using the <code>&lt;b&gt;</code> element, you should use the CSS <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight"><code>font-weight</code></a> property with the value <code>"bold"</code> instead in order to make text bold.</li> </ul></div>
+<h2 id="examples">Examples</h2>
+<div class="section-content"><div class="code-example">
+<p class="example-header"><span class="language-name">html</span></p>
+<pre data-signature="yCJGzgyS/vr9uydADE4SK+H5aQvykvC6oY0I4y2uKko=" data-language="html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>p</span><span class="token punctuation">&gt;</span></span>
+ This article describes several <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>b</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>keywords<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>text-level<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>b</span><span class="token punctuation">&gt;</span></span> elements. It
+ explains their usage in an <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>b</span> <span class="token attr-name">class</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>keywords<span class="token punctuation">"</span></span><span class="token punctuation">&gt;</span></span>HTML<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>b</span><span class="token punctuation">&gt;</span></span> document.
+<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>p</span><span class="token punctuation">&gt;</span></span>
+Keywords are displayed with the default style of the
+<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>b</span><span class="token punctuation">&gt;</span></span>element, likely in bold.<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>b</span><span class="token punctuation">&gt;</span></span>
+</pre>
+</div></div>
+<h3 id="result">Result</h3>
+<div class="section-content"><div class="code-example" id="sect1">
+
+<iframe class="sample-code-frame" title="Examples sample" id="frame_examples" src="https://live.mdnplay.dev/en-US/docs/Web/HTML/Element/b/runner.html?id=examples" loading="lazy"></iframe>
+</div></div>
+<h2 id="technical_summary">Technical summary</h2>
+<div class="section-content"><figure class="table-container"><div class="_table"><table class="properties"> <tbody> <tr> <th scope="row"><a href="../content_categories">Content categories</a></th> <td> <a href="../content_categories#flow_content">Flow content</a>, <a href="../content_categories#phrasing_content">phrasing content</a>, palpable content. </td> </tr> <tr> <th scope="row">Permitted content</th> <td>
+<a href="../content_categories#phrasing_content">Phrasing content</a>.</td> </tr> <tr> <th scope="row">Tag omission</th> <td>None, both the starting and ending tag are mandatory.</td> </tr> <tr> <th scope="row">Permitted parents</th> <td> Any element that accepts <a href="../content_categories#phrasing_content">phrasing content</a>. </td> </tr> <tr> <th scope="row">Implicit ARIA role</th> <td><code><a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/generic_role">generic</a></code></td> </tr> <tr> <th scope="row">Permitted ARIA roles</th> <td>Any</td> </tr> <tr> <th scope="row">DOM interface</th> <td><a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement"><code>HTMLElement</code></a></td> </tr> </tbody> </table></div></figure></div>
+<h2 id="specifications">Specifications</h2>
+<div class="_table"><table class="standard-table">
+<thead><tr><th scope="col">Specification</th></tr></thead>
+<tbody><tr><td><a href="https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-b-element">HTML Standard <br><small># the-b-element</small></a></td></tr></tbody>
+</table></div>
+<h2 id="browser_compatibility">Browser compatibility</h2>
+<div class="_table"><table>
+<thead>
+<tr id="bct-browser-type">
+<th></th>
+<th colspan="6">Desktop</th>
+<th colspan="6">Mobile</th>
+</tr>
+<tr id="bct-browsers">
+<th></th>
+<th>Chrome</th>
+<th>Edge</th>
+<th>Firefox</th>
+<th>Internet Explorer</th>
+<th>Opera</th>
+<th>Safari</th>
+<th>WebView Android</th>
+<th>Chrome Android</th>
+<th>Firefox for Android</th>
+<th>Opera Android</th>
+<th>Safari on IOS</th>
+<th>Samsung Internet</th>
+</tr>
+</thead>
+<tbody><tr>
+<th><code>b</code></th>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-yes">12</td>
+<td class="bc-supports-yes"><details><summary>1</summary>Before Firefox 4, this element implemented the <code>HTMLSpanElement</code> interface instead of the standard <code>HTMLElement</code> interface.</details></td>
+<td class="bc-supports-yes">Yes</td>
+<td class="bc-supports-yes">15</td>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-yes">4.4</td>
+<td class="bc-supports-yes">18</td>
+<td class="bc-supports-yes">4</td>
+<td class="bc-supports-yes">14</td>
+<td class="bc-supports-yes">1</td>
+<td class="bc-supports-yes">1.0</td>
+</tr></tbody>
+</table></div>
+<h2 id="see_also">See also</h2>
+<div class="section-content"><ul> <li>Other elements conveying text-level semantics: <a href="a"><code>&lt;a&gt;</code></a>, <a href="em"><code>&lt;em&gt;</code></a>, <a href="strong"><code>&lt;strong&gt;</code></a>, <a href="small"><code>&lt;small&gt;</code></a>, <a href="cite"><code>&lt;cite&gt;</code></a>, <a href="q"><code>&lt;q&gt;</code></a>, <a href="dfn"><code>&lt;dfn&gt;</code></a>, <a href="abbr"><code>&lt;abbr&gt;</code></a>, <a href="time"><code>&lt;time&gt;</code></a>, <a href="code"><code>&lt;code&gt;</code></a>, <a href="var"><code>&lt;var&gt;</code></a>, <a href="samp"><code>&lt;samp&gt;</code></a>, <a href="kbd"><code>&lt;kbd&gt;</code></a>, <a href="sub"><code>&lt;sub&gt;</code></a>, <a href="sup"><code>&lt;sup&gt;</code></a>, <a href="i"><code>&lt;i&gt;</code></a>, <a href="mark"><code>&lt;mark&gt;</code></a>, <a href="ruby"><code>&lt;ruby&gt;</code></a>, <a href="rp"><code>&lt;rp&gt;</code></a>, <a href="rt"><code>&lt;rt&gt;</code></a>, <a href="bdo"><code>&lt;bdo&gt;</code></a>, <a href="span"><code>&lt;span&gt;</code></a>, <a href="br"><code>&lt;br&gt;</code></a>, <a href="wbr"><code>&lt;wbr&gt;</code></a>.</li> <li><a href="https://www.w3.org/International/questions/qa-b-and-i-tags" target="_blank">Using &lt;b&gt; and &lt;i&gt; elements (W3C)</a></li> </ul></div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; 2005&ndash;2023 MDN contributors.<br>Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.<br>
+ <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/b" class="_attribution-link">https://developer.mozilla.org/en-US/docs/Web/HTML/Element/b</a>
+ </p>
+</div>