HTML Formatting Elements<b> - Bold text. <strong> - Important text. <i> - Italic text.
The text written under <b> tag makes the text bold presentationally to draw attention. The main difference between these two tag is that the strong tag semantically emphasizes on the important word or section of words while the bold tag is just offset text conventionally styled in bold.
Difference between strong and bold The difference between the two tags is that the bold tag is intended to draw attention to the text, while the strong tag also highlights the text semantically and indicates that this is an important word or section of text.
No. <i> and <b> are not deprecated, at least not in HTML 4.
Also consider the <strong>
tag. It's much better for screen readers and therefore better for accessibility. Search engines also use <strong>
tags to determine important content similar to how they use header tags <h1>
, <h2>
, etc (although <b>
will also have similar meaning to search engines). If you want to stress importance of text, use <strong>
. If you don't want to stress importance, use the <b>
tag or use the font-weight:bold;
style on the element or in the CSS.
Although, if you are bolding the entire paragraph, it's probably better to use the CSS option. This will reduce the affect on screen readers and it probably doesn't make sense to have an entire paragraph emphasized. But on the other hand, I've seen bold used to emphasize an entire paragraph before for good reason. In which case, font-weight:bold;
is what you want to use, likely in a class/style.
In the end, <strong>
, <b>
or font-weight:bold;
will all work and accomplish something similar visually (probably exactly the same), but they have slightly different meanings. Also, make sure that if what you're bolding is a header, use the header tags: <h1>
, <h2>
, etc.
You're thinking of the CSS property font-weight
:
p { font-weight: bold; }
If the text's meaning is semantically strong, use the strong
element. If not, use a semantic named class (one that clearly shows the meaning of the element, don't mix presentation and data by calling it bold
etc) and reference it in your CSS.
<span class="important-message">I'm important!</span>
.important-message {
font-weight: bold;
}
Some people still use the b
element as a presentational hook, but it hasn't been deprecated, though most people favour the strong
element nowadays. Just make sure they are used correctly.
The <b> tag is alive and well. <b> is not deprecated, but its use has been clarified and limited. <b> has no semantic meaning, nor does it convey vocal emphasis such as might be spoken by a screen reader. <b> does, however, convey printed empasis, as does the <i> tag. Both have a specific place in typograpghy, but not in spoken communication, mes frères.
To quote from http://www.whatwg.org/
The b element represents a span of text to be stylistically offset from the normal prose without conveying any extra importance, such as key words in a document abstract, product names in a review, or other spans of text whose typical typographic presentation is boldened.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With