Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
290 views
in Technique[技术] by (71.8m points)

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

Note: I know <b> is presentational and <span style="font-weight:bold> is a better way, and <strong> and <em> are for emphasis but my question is not regarding this.


Should we convert every <b> to <strong> blindly? Many people do this, they think <b> is not good as per web standards so they convert every <b> to <strong> upon site redesign, content re-population, new site design and people suggest this to others also.


Dreamweaver has also given the option to convert all <b> and <i> to <strong> and <em> on code paste in design view and when we use B and I Which people use blindly.

alt text http://shup.com/Shup/280420/1101118332-My-Desktop.png

And Dreamweaver (if above option is checked) and many online WYSIWYG editor give output in <strong> and <em> while button shows B and I.

alt text http://shup.com/Shup/280425/1101118921-My-Desktop.png

In my opinion it's creating a misconception about <strong> and <b>


When we get content from a client we don't know where the client wants to give emphasize and where he just wants to use bold text for presentation purposes. What should we do in this circumstance? No one has the time to give to decide for each instance (us and the client), whether it should be <b> or <strong>, <i> or <em>

What are the pros and cons to convert every <b> and <i> into <strong> and <em> blindly if we are saying our site is accessible?


Update: remember <b> and <i> are not deprecated they are in HTML 5 specification

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

As others have mentioned using <strong>, <em>, <cite> etc. adds semantics, and this is important because you say something about why you want to emphasize something, and increases the readability of your html, because you know why its 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, mark it as <strong> for instance, if not use <b>.

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...