Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

A while ago I learned to use proper CSS stylesheets on my websites. However, on Wikipedia and eBay and other sites I see the deprecated <b><i> tags being used. I was going for <span style="font-weight:bold;"></span> but I never see it done that way.

So what's up with the WC3 standards. Are <b> tags back in style?

share|improve this question
3  
FYI the word is deprecated, not depreciated. The latter means to decrease in value. –  DisgruntledGoat Mar 23 '12 at 10:29

3 Answers 3

up vote 9 down vote accepted

@Su is correct, but to address @Konrad's comment - W3.org (home of the W3C) answers this question directly

The HTML5 specification redefines b and i elements to have some semantic function, rather than being purely presentational. However, the simple fact that the tag names are 'b' for bold and 'i' for italic means that people are likely to continue using them as a quick presentational fix.

and

You should always bear in mind that the content of a b element may not always be bold, and that of an i element may not always be italic. The actual style is dependent on the CSS style definitions. You should also bear in mind that bold and italic may not be the preferred style for content in certain languages.

You should not use b and i tags if there is a more descriptive and relevant tag available. If you do use them, it is usually better to add class attributes that describe the intended meaning of the markup, so that you can distinguish one use from another.

The rest of this article will explain this in more detail.

share|improve this answer
1  
Su may be right on technical issues that I never objected to but still hasn’t answered my initial question, instead hiding behind the smoke-screen of the HTML5 standard. My initial question, as a reminder, was “But shouldn’t the styling still be preferentially done in the stylesheet rather than the HTML?” Nothing in the documents you or Su linked to suggest otherwise, quite on the contrary. –  Konrad Rudolph Mar 23 '12 at 17:06
1  
@KonradRudolph yes the styling should always be done in the stylesheet - the issue you raise is semantics, a html page alone, without the CSS should be readable/usable and that's why using these tags correctly is important. –  toomanyairmiles Mar 23 '12 at 17:17
    
It says <b> and <i> are not appropriate for some languages. Unfortunately it doesn't tell me what those languages are. –  unixman83 Mar 24 '12 at 5:46
1  
@unixman83 I think you would have to know the language well to decide, but certain Asian languages which scan top to bottom may not work with the b and i tags well. –  toomanyairmiles Mar 24 '12 at 11:04

The b and i tags are not deprecated. (In specs: HTML5, HTML4) What you're concerned with is appropriate use of the tags.

If you're trying to show emphasis in a meaningful sense(as now), then you should use em or strong.

If you just need some text to look italic/bold as a stylistic choice, then you use i or b. Consider the logo right here at top of the site, which is effectively "Pro Webmasters". The bolding doesn't serve any "meaningful" purpose; you don't even read it with any different emphasis. It's only there so the words are a bit more easily differentiated. (Addendum: As @toomanyairmiles brings up, HTML5 does overload b and i with some semantic intent, though it can also occur separately from stylistic use, which isn't exactly my favorite implementation.)

share|improve this answer
1  
But shouldn’t the styling still be preferentially done in the stylesheet rather than the HTML? After all, the whole purpose of having separate HTML and CSS was to separate the concerns (contents vs. style). That this separation is imperfect is one thing; to intentionally breach it is quite another. –  Konrad Rudolph Mar 23 '12 at 11:29
1  
You're right the separation is imperfect, but wrong about the breach. This is baked right into the browsers. Create a plain HTML document with no stylesheet, add some text to it with a few i and b tags, and open in any browser. What do you see? With the older specs, it's just a simple fact that the elements were there. HTML5 chooses to acknowledge that plain bolding/italic happens enough that practicality demands them. In that regard, you should familiarize yourself with the priority of constituencies. –  Su' Mar 23 '12 at 16:44
1  
You seem to be confusing the order events. HTML5 is actually based in part on existing behavior. Elements like header exist because it's a near universal pattern to have a "header" in layouts. The same goes for the b tag. Again: read the priorities. You're arguing for theoretical purity. That's on the bottom of the list. –  Su' Mar 23 '12 at 16:50
1  
You are still conflating two issues. I get that HTML5 acknowledges and stands by the existence of these tags and continues to support them rather than phase them out (which would be unrealistic). Thumbs up for that. However, it’s a different thing to then go on and say “so, yeah, they have their place” – because they really don’t, except as a legacy. If you are creating new content, there’s no reason (other than lazyness – it’s shorter to write, after all, and I guess that is a valid argument) to prefer <b> over a CSS class. –  Konrad Rudolph Mar 23 '12 at 16:55
1  
Su, the specs explicitly say that “The b and i elements are widely used — it is better to give them good default rendering for various media including aural than to try to ban them.” Which is entirely in line with what I said. Nowhere does the standard recommend them for their usefulness, it merely says that it would be impractical to ban them, which I entirely agree with (and I’ve stated this repeatedly). Nowhere did I suggest that they are (or should be) deprecated. –  Konrad Rudolph Mar 23 '12 at 17:10

As far as I know it's not going against standards to use the <b> or <i> tags on a website. If you think about it, if a user can't load CSS styles on their browser of choice then how will they differentiate between bold text or italic text without the use of the tags?

I know somewhere that they recommended using <strong> tags instead of <b> tags, but no where have I seen anyone say <b> and <i> aren't standards compliant.

share|improve this answer
    
This argument stems primarily from the rhetoric coming from W3C many years ago when CSS 1 first came out. W3C then stated that their desire was to eliminate semantic markup from HTML such as </b> tags. –  unixman83 Apr 26 '12 at 13:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.