To strong or to b


About a year ago, I filed a bug; when you highlighted text, and then clicked the BOLD tool bar button, it set the text to <strong> not bold.  But the bold button is supposed to make things bold, not strong isn’t it?


In most browsers, the rendering of <b> and <strong> are identical, so they’re pretty interchangeable.  But this doesn’t work so well in cases where the user might be using a screen reader.  Typically <b> is used as a visual presentation marker, where as <strong> implies that there is to be a stronger emphasis here.  Some screen readers will change how they read things in <strong> tags, but not for <b> tags.


So which one is right?  We decided on using <strong> as the correct markup to emphasize something.  I know we’ll hear from some people that this is the wrong thing to do.  If you’re trying to reduce your html code base, and send less data down the pipe, than this certainly isn’t the way.  But, it is the correct way to go about doing it if you want your web site to be fully accessible.  You can always cut back a character here or there to make up for it 😉

Comments (2)

  1. Ian Smith says:

    I think you are doing the right thing (although it’s very annoying that Microsoft’s WHidby server controls generate b tags when they should be generating strong tags). You should be aiming to separate presentation from semantics. Use HTML for semantics (this is a table, this is an unordered list, this is a paragraph) and CSS for presentation (this is bold, this is red, this is italics). The strong tag is semantic the b tag is presentational so in your HTML you should be coding strong not b. The same goes for em (for emphasis) vs the i (italics) tags.

  2. Björn Graf says:

    Well, since the b tag is deprecated in the more recent (HTML 4.01 and above?) w3 recommendations and VS2005 seems to default to XHTML1.1 (which is a questionable choice especially as it won’t validate out of the box due to the missing XML declaration and wrong MIME type of the page – questionable goal, too, but that’s beyond this comment =]) strong is the right tag to use.

    Side note: the rendering of any tag is subject to the applied CSS anyway.

    — b.gr