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 Text Emphasis, Strong, and Horizontal Rules

Gemma Barrows
Gemma Barrows
3,171 Points

Difference between <strong> and <b> and <em> and <i>?

Hi everyone, I've used <b> and <i> tags in my HTML before and I don't really understand how they differ from the tags introduced in this video.

Is my HTML still valid if I continue to use <b> and <i>, or is it best practice to switch to <strong> and <em>?

Thanks!

2 Answers

John Burkhard
John Burkhard
16,314 Points

<strong> and <em> add extra semantic meaning to your document as well as increasing accessibility for people with visual impairment and using screen readers. Using <b> or <i> within a document is specifically for styling purposes, while using <em> indicates emphasis and <strong> indicates stronger emphasis.

Gemma Barrows
Gemma Barrows
3,171 Points

Ahh, that makes sense! Thanks for the quick reply!

Jeremy Castanza
Jeremy Castanza
12,081 Points

For a more technical explanation, here's the W3C specification. They give some specific examples of when these tags have issues. http://www.w3.org/International/questions/qa-b-and-i-tags