Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML HTML Forms HTML Mastery

Instruction indicates to make text bold. I use <b> instead of <strong> Why is one valid not the other?

Shouldn't both be valid? Where

<b> and <i>

in html5 is not yet deprecated. Therefore it is still a valid tag under HTML5.

3 Answers

Shawn Flanigan
PLUS
Shawn Flanigan
Courses Plus Student 15,815 Points

chrisp,

Good point. You're right that <b> is a valid way of creating bold text in HTML5. Technically, the quiz should probably ask you to "Create a paragraph and give some of the text a strong emphasis."

The article that Rich linked to (and the HTML5 documentation) point out that semantically there's a difference between the <strong> and <b> tags. While many people put style-specific markup in their HTML, it's generally considered best practice to leave style information to the css and keep the HTML as meaningful as possible...and <b> is mostly about style, not meaning. In that spirit, there's been a recent push toward using <strong> instead of <b> when trying to connote emphasis.

Thank you Shawn. Yes, exactly how I felt about the quiz in terms of accurate wordings, it should be worded differently or either makes both of B tag and Strong Tag as a valid answer.

In terms semantic I had understanding that strong tag is better off. I think this is likewise well for web accessibility when parsing html contents from screen reader for users with visual impairment, using strong tag would accommodate accessibility.

In this case, this case the lesson category is focus on Core HTML. Covering presentation, html tags, and some semantic, and b and i tag seems to be valid answer along with strong and em.

In the documentation that Rich posted, it says b tag still has uses for it and perhaps that is why it is not deprecated in html 5. Get me thinking about 'what are the exceptions to using b and i tags :p. Thanks again.

James Barnett
James Barnett
39,199 Points

It's worth noting that ...

  • 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.

from: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/b

Thanks James, appreciate your answers.

Hi chrisp,

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong

The above may help under the Bold vs Strong title.

Thanks

-Rich

Thanks for the link Rich!

No problem!

-Rich