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

JavaScript JavaScript Basics (Retired) Making Decisions with Conditional Statements The Conditional Challenge Solution

Naivedya Bansal
Naivedya Bansal
5,483 Points

<strong> and <b> What is the difference?

what is the difference between <strong> tags and <b> tagS ?

3 Answers

Hi,

b is used for styling a word / sentence bold whereas strong is used semantically to indicate importance.

This is a great way of explaining it over on Stack Overflow.

EDIT: The info over on w3schools may also help :)

Hope that helps.

-Rich

Stan Goldmann
Stan Goldmann
2,035 Points

In HTML5 'strong' and 'b' both exist and have a different meaning.

The 'b' tag is for "offset text conventionally styled in bold without conveying any extra emphasis or importance".

'strong' is different. It "represents a span of text with strong importance." There is semantic meaning of importance here. In fact, a 'strong' tag within another strong tag has even more importance. There is nested importance.

Source : http://engineeredweb.com/blog/2013/html5-semantic-diff-bold-strong/

Additionally, it's less than ideal practice to use either. The "best practice" way to style those elements is to use CSS to set their properties rather than using the HTML. That keeps all of your styling in one place, which is better for future maintenance.

Noah Schill
Noah Schill
10,020 Points

Is there a way to select a specific word in CSS using selectors?