DEV Community

Discussion on: 5 Common HTML Mistakes you should avoid.

Collapse
 
alvaromontoro profile image
Alvaro Montoro • Edited

I like the idea of the third point: don't use them because of how the browser represents the tags, but because of their meaning. A quick note on it though, <b> and <i> changed semantics and they don't mean the same thing anymore:

Browsers still represent them as bold and italics (which I guess makes sense for "backward compatibility"), but they are no longer presentational elements. They have a meaning.

Collapse
 
abhirajb profile image
Abhiraj Bhowmick

Oh I see. Thanks for the correction. Cheers !

Collapse
 
supportic profile image
Supportic

Doesn't matter what <b> and <i> means. The WCAG accessibilty standard tells you to use <strong> and <em> for assistive technology.

w3.org/WAI/WCAG21/Techniques/html/H49

Collapse
 
auroratide profile image
Timothy Foster

WCAG seems to say use semantic markup for special text. <b> and <i> qualify as semantic markup in HTML5. Therefore I see no reason not to use those tags.

Collapse
 
alvaromontoro profile image
Alvaro Montoro • Edited

But it actually matters what they mean. It matters as part of the HTML standard and it matters for accessibility too. And that's the point of my comment: there are cases in which you will use <b> and <i> because they provide the right meaning. For example, if you use <em> for an idiomatic or technical term, you are using the wrong semantic tag. It should be <i> instead. And if you use <i> just to have something in italics, then yes, that's a wrong use of <i>.

Thread Thread
 
supportic profile image
Supportic

OMG I am so sorry, I read this wrong the whole time...