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" ?

4

6 Answers 6

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.
7
  • This is not my question. BY THE WAY what alternative will you use as a CSS alternative for <b>? Jun 17, 2010 at 6:06
  • 3
    @metal-gear-solid: font-weight: bold; perhaps? Jun 17, 2010 at 6:10
  • @codeka- i don't want to make whole <p> bold. Jun 17, 2010 at 6:11
  • 1
    @metal-gear-solid - The rule is, "if your text needs semantic emphasis, then use <strong>", which answers your question pretty well I think. A <span> implies no semantic or presentational meaning, and could be used as a CSS hook instead of <b>. 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, 2010 at 7: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. Jun 17, 2010 at 8:27
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.

1
  • 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, 2020 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.

1
  • "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, 2020 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.

1
  • 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, 2020 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.

5
  • MS Word only has button for to make text Bold. I think there is no button to make Strong. Jun 17, 2010 at 5: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. Jun 17, 2010 at 5:57
  • 2
    thing is, 95% of the Word users do not use styles (mostly because they do not know they exist)
    – nico
    Jun 17, 2010 at 6:01
  • @nico: I know. We're kind of winning the war against <b> in HTML, but I think using styles over the "B" button is a lost cause in Word ;) Jun 17, 2010 at 6: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, 2010 at 8: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.

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