Is It Ok to Use <Strong> in Place of <B> Blindly

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

As others have mentioned, using <strong>, <em>, <cite> etc. adds semantics. This is important because you say something about why you want to emphasize something and increase the readability of your html, because you know why it's in bold.

Furthermore, screen readers use the strong tags to make an audible difference when reading it aloud.

Maybe you could think about the audio represenation as a guide. If you would want a difference when read aloud, for instance, mark it as <strong>. If not, use <b>.

Then there is the issue of rendering: I don't actually know if all browsers will render a <strong> as bold and if it will stay that way.

So in short: <strong>No</strong>.

When to use <strong> and when to use <b>?

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.

Is it bad practise to use the <b> tag?

<strong> means strong emphasis. The idea is that when using a different medium (e.g., text-to-speech), you can express strong emphasis through changing the tone.

<b> means bold. That makes no sense outside of screen display, and more importantly, doesn't explain why something is bold.

What is the logic behind to use Semantic meaningful markup?

Semantic markup allows scripts to understand context. This may be beneficial for screen reader software, but it will also be beneficial for Google and other search bots.

According to HTML specs, <strong> and <em> communicate emphasis, whereas <b> and <i> simply mean "display bold" and "display italic". <b> and <i> should be used in instances where emphasis is specifically not desired. For example, when italicizing a book title.

When search bots are trying to gain semantic understanding of content, it is reasonable to assume they give greater preference to semantic tags.

Why HTML 5 still have support for Presentational elements?

Two reasons come to mind:

  1. Because some people (not me, here is a primer about this opinion and here are the WHATWG FAQ about this) don't think of them as presentational. They argue, that <b> has semantics of its own, for example, where <strong> is not right and the text should be bold anyways (IMHO therefore we have <span>)

  2. Because HTML5 has a pragmatic and backwards compatible approach: What worked in HTML4 should work too in HTML5. They argue, that this is why XHTML2 died.

Should we use fieldset even for one search box input?

No. There is no point in using fieldset elements unless you are dividing the form up into logical sets of fields.

It is excellent for (for example) marking up a set of fields for delivery address and some nearly identical ones for billing address. If you can't make sets (plural) don't use a fieldset element.

Standards for Web Programming

I hope that company coding standards for Web Developers include W3C standards, but commercial pressures will tend to encourage whatever solution gets the job done.

I would love to be proved wrong in this regard.



Related Topics



Leave a reply



Submit