HTML 注意力转移元素 (
<b>
)
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
<b>
for styling text; instead, you should use the CSS
font-weight
property to create boldface text, or the
<strong>
element to indicate that text is of special importance.
| 内容类别 | 流内容 , 措词内容 ,可触及内容。 |
|---|---|
| 准许内容 | 措词内容 . |
| Tag omission | None, both the starting and ending tag are mandatory. |
| Permitted parents | Any element that accepts 措词内容 . |
| Implicit ARIA role | 无对应角色 |
| Permitted ARIA roles | 任何 |
| DOM 接口 |
HTMLElement
|
此元素只包括 全局属性 .
<b>
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).
<b>
element with the
<strong>
,
<em>
,或
<mark>
元素。
<strong>
element represents text of certain
importance
,
<em>
puts some emphasis on the text and the
<mark>
element represents text of certain
relevance
。
<b>
element doesn't convey such special semantic information; use it only when no others fit.
<b>
element. For this purpose, use the
<h1>
to
<h6>
tags. Further, stylesheets can change the default style of these elements, with the result that they are not
necessarily
displayed in bold.
class
属性在
<b>
element in order to convey additional semantic information as needed (for example
<b class="lead">
for the first sentence in a paragraph). This makes it easier to manage multiple use cases of
<b>
if your stylistic needs change, without the need to change all of its uses in the HTML.
<b>
element was meant to make text boldface. Styling information has been deprecated since HTML4, so the meaning of the
<b>
元素已改变。
<b>
element, you should use the CSS
font-weight
property with the value
"bold"
instead in order to make text bold.
<p> This article describes several <b class="keywords">text-level</b> elements. It explains their usage in an <b class="keywords">HTML</b> document. </p> Keywords are displayed with the default style of the <b>element, likely in bold.</b>
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
b
|
Chrome 完整支持 Yes | Edge 完整支持 12 |
Firefox
完整支持
1
注意事项
|
IE 完整支持 Yes | Opera 完整支持 Yes | Safari 完整支持 Yes | WebView Android 完整支持 Yes | Chrome Android 完整支持 Yes | Firefox Android 完整支持 4 | Opera Android 完整支持 Yes | Safari iOS 完整支持 Yes | Samsung Internet Android 完整支持 Yes |
完整支持
见实现注意事项。
<a>
,
<em>
,
<strong>
,
<small>
,
<cite>
,
<q>
,
<dfn>
,
<abbr>
,
<time>
,
<code>
,
<var>
,
<samp>
,
<kbd>
,
<sub>
,
<sup>
,
<i>
,
<mark>
,
<ruby>
,
<rp>
,
<rt>
,
<bdo>
,
<span>
,
<br>
,
<wbr>
.