25

Possible Duplicate:
Is it ok to use <strong> in place of <b> blindly ?

When to use <strong> and when to use <b> or other ways to give look of bold? strong has semantic value ( and useful for screen reader while b is presentation (and even valid in HTML 5).

my question is not what is the difference between strong and b.

The question is when to use semantic tag and when to use just to make text bold

Should I always use <strong> if client's content files (MS word files) has some words bold in content paragraphs?

alt text http://shup.com/Shup/365676/11051764618-My-Desktop.png

How can we know when client want to give emphasis to text and when he just want to make text bold for presentation/aesthetic purpose?

If it's client job to tell us, then how to explain this scenario to client to give us clear info on "when he just want to make text bold for presentation/aesthetic purpose" ?

Community
  • 1
  • 1
Jitendra Vyas
  • 148,487
  • 229
  • 573
  • 852
  • This is very similar to your own question: http://stackoverflow.com/questions/2243074/is-it-ok-to-use-strong-in-place-of-b-blindly There are already some good answers there. – takeshin Jun 17 '10 at 09:11
  • 1
    The sample you provided, has no semantic meaning. In this case I'd use **``**. – takeshin Jun 17 '10 at 09:46
  • Please read [‘A reconsideration—in defence of and (or: people fear what they don’t understand)’](http://csswizardry.com/2010/01/a-reconsiderationin-defence-of-b-and-i-or-people-fear-what-they-dont-understand/) and [‘HTML5: and tags are going to be useful (read: semantic) again!’](http://stellify.net/html5-b-and-i-tags-are-going-to-be-useful-read-semantic-again/) and of course [‘The `b` element’](http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-b-element). – Marcel Korpel Jun 18 '10 at 04:02
  • 2
    And indeed, that's a bad sample, as we cannot distill the semantic meaning of the words in that text (at least I cannot). – Marcel Korpel Jun 18 '10 at 04:07

6 Answers6

19

I've always followed a simple rule of thumb:

  • <strong> means "strong emphasis", and implies no particular visual style. It has semantic meaning, but could look like anything.
  • <b> is used to apply a bold visual effect to text, but is a presentational tag like <font> and so should be avoided (where possible) in favour of CSS.
Chris
  • 6,568
  • 3
  • 22
  • 21
  • This is not my question. BY THE WAY what alternative will you use as a CSS alternative for ``? – Jitendra Vyas Jun 17 '10 at 06:06
  • 3
    @metal-gear-solid: `font-weight: bold;` perhaps? – Dean Harding Jun 17 '10 at 06:10
  • @codeka- i don't want to make whole

    bold.

    – Jitendra Vyas Jun 17 '10 at 06:11
  • @chris - my question is, when to use and when to use or any css alternative? see first line of my question. the thing you explained i already know. – Jitendra Vyas Jun 17 '10 at 06:14
  • 1
    @metal-gear-solid - The rule is, "if your text needs *semantic emphasis*, then use ", which answers your question pretty well I think. A implies no semantic or presentational meaning, and could be used as a CSS hook instead of . It's not ideal, and not something I personally would do, but it works... I've never had to bold certain parts of a paragraph just for presentational effect so I can't give you a complete guide here. – Chris Jun 17 '10 at 07:29
  • 1
    Personally I use `strong` or `em` when I imagine the word being emphasized when it's read. That's my definition of "semantic emphasis." Words that are bolded without actually being emphasized -- like, say, vocabulary words in an elementary school textbook -- get bolded with `b` or CSS. – Max Lybbert Jun 17 '10 at 08:27
  • `b` != `font` (b is not deprecated). And *(where possible)* in your post, should be emphasized :) – takeshin Jun 17 '10 at 09:36
12

How can we know when client want to give emphasis to text and when he just want to make text bold for presentation/aesthetic purpose?

Read the client's text with understanding.

  • use <strong> when the context says that the bold text is more important than the other (and it is inline)
  • use <b> if it just should be bold (even in database, feed reader or without stylesheets). In this case boldness may be used to catch the readers eye.

When in doubt, ask the client what did he meant.

To save you and yourself a hassle, ask the client to use formatting styles in his editor. This is very useful feature, pity that there few people who do know what for this feature is.

Edit:

This is strong and this is bold. Any difference?

All the problems begin here. If the strong were by default colored RED (no red markup on SO), and normal weight, there would be no questions like this.

takeshin
  • 49,108
  • 32
  • 120
  • 164
  • 3
    The problem with this answer is that "more important than the other" and "just should be bold ... to catch the reader's eye" are the same thing. It is a distinction without a difference. Why would you want to catch the reader's eye if the content isn't more important? – arnoldbird Jan 16 '20 at 20:57
4

There's no "right" answer to this (which is probably why semantic markup isn't in a good state).

Depending on the way your client works I'd say your proposal to replace emboldened content in paragraphs with <strong>, and everything else with relevant heading styles, is reasonable. It may be a good idea to sample the documents to establish what practice has been used.

Jeremy McGee
  • 24,842
  • 10
  • 63
  • 95
  • "There's no 'right' answer" seems like the right answer, given that everyone here and elsewhere concedes that it's a matter of opinion. – arnoldbird Jan 16 '20 at 21:02
3

First ask the client "why have you highlighted these words?" and use that to inform your decision. If you can't get a clear answer, I'd use <B> since it's better to not imply that there are semantics to the highlighted words when in fact there are none. Use of <B> can be used as a clear indication that you have unsatifactory presentational markup, and therefore helpful to future maintainers that it can be freely corrected in the light of new information about the reason for the highlighting.

Alohci
  • 78,296
  • 16
  • 112
  • 156
  • I don't understand suggestions that one or the other is more semantic. B means bold. Strong means strong. Neither is more or less semantic than the other, and they both mean the same thing. – arnoldbird Jan 16 '20 at 20:59
1

If you're doing a conversion of a word document to HTML, then I think <b> is a better choice, because you're conveying the fact that the text was bold in the word document. Word uses styles to apply semantic meaning, so if it's marked with the "Strong" style, then you use the <strong> tag in the HTML.

Dean Harding
  • 71,468
  • 13
  • 145
  • 180
  • MS Word only has button for to make text Bold. I think there is no button to make Strong. – Jitendra Vyas Jun 17 '10 at 05:50
  • 1
    @metal-gear-solid: Of course there is: select text, apply the "Strong" style. It's not a single "strong" button, but styles are the "semantic" way to markup word documents. – Dean Harding Jun 17 '10 at 05:57
  • 2
    thing is, 95% of the Word users do not use styles (mostly because they do not know they exist) – nico Jun 17 '10 at 06:01
  • @nico: I know. We're kind of winning the war against `` in HTML, but I think using styles over the "B" button is a lost cause in Word ;) – Dean Harding Jun 17 '10 at 06:11
  • styles are certainly more prominent in the UI than they were before, right there at the top, quite large. I think there's hope. – Douglas Jun 17 '10 at 08:41
1

Using CSS to define a style other than default bold for a <strong> tag is understandable.

Using CSS the same way on a <b> tag would be more questionable.

mouviciel
  • 66,855
  • 13
  • 106
  • 140