views:

796

answers:

16

Semantically speaking, is there an appropriate place in today's websites (late 2008+) where using the bold <b> and italic <i> tags are more useful than the more widely used <strong> and <em> tags?

+10  A: 

Never. They are removed in XHTML 2.0 as they are presentational tags. CSS should be used to bold/italicise content.

edit: If you're looking for a purely presentational tag, that's what the SPAN tag with a class and a little CSS is for.

ceejayoz
@ceejayoz XHTML 2.0 is dead! Also, according to the next HTML specification (HTML5) you're wrong: <b> and <i> are still present, and they have semantic meanings.
abernier
@abernier This answer was written a year before the W3C allowed XHTML2 to expire, and HTML5 has essentially deprecated the old "bold" tag and replaced it with one with similar semantic meaning to the "strong" tag, as an odd dance intended to grandfather in the existing browser behaviour.
ceejayoz
@ceejavoz see: http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-i-element it's not depreciated, it's more like a last resort element, but with meaning : "an alternate voice or mood, or otherwise offset from the normal prose"
abernier
The point is, though, that they've essentially removed the old b/i tags and created new ones with the same names but actual semantic meanings. The old tag meanings - bold and italic - are no longer present.
ceejayoz
A: 

When writing websites for mobile devices. They don't always support the 'latest and greatest' standards, are depreciated but not deleted from all modern browsers, and simply take up less space and bandwidth (though in theory the streams are compressed by either the websites or the wireless browser, it can't be counted on).

Adam Davis
Are you aware of any mobile devices that can't handle STRONG or EM tags?
ceejayoz
At the moment, no, however even if every single mobile device still being used supported these tags, the point about bandwidth still stands. In most cases this would not be useful (compression, etc) but for a specific website catering to a specific user <b> and <i> might be the right choice.
Adam Davis
If you've got enough I/B tags to make a bandwidth difference, even on a mobile phone, it's either a) too long of a page for a mobile phone anyways or b) you're bolding every other word and need to stop doing that. Heh.
ceejayoz
A: 

The <b> and <i> tags don't have semantic meaning, whereas <strong> and <em> do. If a reader read the block of text aloud it would react to the <strong> and <em> tags, whereas the <i> and <b> tags would be ignored, and treated and purely visual elements. I tend to regard <i> and <b> as deprecated.

Sean Cameron
A: 

Whenever you want to do things incorrectly ... just kidding.

The real answer is never, these tags have been deprecated by the W3C

Andrew G. Johnson
actually, they're not deprecated, at least not in XHTML 1.0 - http://www.w3schools.com/tags/ref_byfunc.asp
Nathan Chase
A: 

Neither <b> nor <i> are semantic tags, so purists would say they should not be used. Where I've seen their use justified are in things like putting online content in print where text was bolded or italicized as a matter of convention, but not as a manner of strengthening or emphasizing content.

The easy example is if you're putting online a magazine article that references a book by its title: you may want to put the book title in italics, but the italics are not for emphasis, so the <em> tag would be inappropriate. You could use <i> here, but the semantic thing to do would be to use something like <span class="booktitle"> and then use CSS to make booktitles italics. You are referencing a title, not putting emphasis, and you wouldn't want a screen reader to put verbal emphasis on the title.

My personal opinion is to not use either <b> or <i> today, but using <strong> or <em> as their substitutes when you aren't really looking to do anything besides bold or italicize the text is equally incorrect.

Daniel Papasian
In your example, you'd actually want to use <cite />. :)
Domenic
A: 

For markup generated by a WYSIWYG editor.

+7  A: 

While in general I would stay away from non-semantic tags like b and i, strong and em are not direct replacements for b and i.

I would use b or i when it's only presentation you're going for, and what you're marking up has no semantic meaning. For example, a logo like stackoverflow could be marked up with stack<b>overflow</b>. The "overflow" portion has no semantic meaning over "stack", yet stack<span class="overflow-logo">overflow</span> doesn't offer anything either.

Hope this helps.


Not sure how to comment (edit: need moar karma!), but this is in reply to Erik's comment.

Please read the HTML5 working draft. It gives a good explanation on when to use b.

The b element represents a span of text to be stylistically offset from the normal prose without conveying any extra importance, such as key words in a document abstract, product names in a review, or other spans of text whose typical typographic presentation is boldened.

"overflow" does not have emphasis over "stack" in the logo, therefore wrapping "overflow" with em is semantically incorrect.

broady
I don't agree. I would implement your example as <h1>stack<em>overflow</em></h1>. It's a header, emphasis is on overflow. Alternatively, you could use an image for the logo, and just let the text be.
Erik van Brakel
I wasn't aware of this specification of the b and i tags. In that case, I think you are right. Although I don't know if I agree with the examples they give in the draft. I think this would be a better example.
Erik van Brakel
A: 

@dannyp, for book titles, you should not use i but cite instead.

broady
A: 

I think when you're trying to make your markup meaningful, these are rarely useful.

There are, however, new tags that produce some of the same results, but which provide even more semantic value. I like to use the <cite> tag when I'm referring to the name of a book, for example, as it still gets italicised, but the HTML now carries meaning about why.

There are a variety of other semantic tags that can also affect formatting listed here:

http://www.w3.org/TR/xhtml2/mod-text.html

Sean McMains
A: 

I've been using <b> for years to indicate key words on my web site. I wrote a small utility that crawls the site looking for <b> tags and adds them to an index. I use <strong> when I want to bold a word without adding it to the index. I have used this convention for years -- too late to quit now.

+4  A: 

According to the HTML 5 spec, <b> and <i> should be used when appropriate.

On the i:

[A] span of text in an alternate voice or mood, or otherwise offset from the normal prose, such as a taxonomic designation, a technical term, an idiomatic phrase from another language, a thought, a ship name, or some other prose whose typical typographic presentation is italicized.

On the b:

[A] span of text to be stylistically offset from the normal prose without conveying any extra importance, such as key words in a document abstract, product names in a review, or other spans of text whose typical typographic presentation is boldened.

Generally speaking, "when appropriate" is deemed to be as a last resort, when all other semantic options have been exhausted. "Presentational" though they may be, it would certainly be a disservice to their semantic cousins <em> and <strong> to consider them always italic or bolded, respectively.

Daniel Stockman
How can you possibly exhaust semantic options? A SPAN with a class of "keyword", "product_name", etc. would work in all the example situations. That's the entire reason *for* the SPAN tag.
ceejayoz
@ceejayoz See my example of a logo in my answer.
broady
+4  A: 

On http://www.webmasterworld.com/forum21/7095-1-15.htm there's a good comment:

"If page readers really read every <strong> tag in a strong voice, or really emphasize every <em> section on a page, then the poor user gets a page shouting at her or him on a regular basis.

I think this issue is really a no-brainer. If I am setting a bold or italic font for purposes of typography only, then I use <b> and <i>. If there's a word or phrase that I want to emphasize as I would in speaking, then - and only then - do I use <strong> or <em>."

Nathan Chase
That's what SPAN is for, not B and I.
ceejayoz
A: 

It could be argued that there is still a use for the <i> tag: when expressing the scientific name (aka the Latin name) of a species. The scientific name of a species is, by convention, usually presented in italics. Example. It is semantically incorrect to use <em> in this situation because one is not trying to emphasise the name but rather merely distinguish it visually. It may be more appropriate to use something like <span class="sci-name">, but when one considers that most scientific names are composed of words of the italic languages, mainly Latin, the <i> tag becomes a rather sematically rich and convenient solution.

Charles Roper
A: 

There are technical rules, but here are my two rules of thumb:

1) If you are writing something where, if spoken, you would emphasize a word, < strong > and < em > are appropriate. (E.g., "You have got to be sh*tting me, Pyle!")

2) If you are emphasizing a word for a technical reason, but would not emphasize the word in spoken conversation, < b > and < i > are appropriate. (E.g., "He boarded the RMS Titanic and sailed away, never to be seen again.")

Don't leave out other tags like < cite >, though!

Robert D.
A: 

Officially, <i /> and <b /> are "presentational" and shouldn't be used. While many developers think that <em /> and <strong /> are presentational, they are not. They are generally italicized and bolded resopectively, but the CSS can (and should, when appropriate) change how the emphasis and strongness could be displayed.

Similar things could be done with css on a <span /> tag, and many consider that the preferred method, but it isn't substantiatable with the specification.

McKay
+1  A: 

Sean McMains, <cite> is by no means new. It dates back to 1993.

charlesroper, if you are putting something in italics because it is Latin, then use <span lang="la"> and [lang=la] { font-style: italic; }

Jim