Log in

View Full Version : <b> versus <strong>



John_fresh
01-26-2007, 11:22 PM
Hi,
Both the above appear to do the same thing to text on a web page.
Have I misunderstood their use?
Do Search engines view them differently?
Thanks

mburt
01-26-2007, 11:38 PM
Well, there's no difference that I know of, except for the fact the <b></b> takes up less time to type. Try running it in the validator see what it has to say.

Twey
01-26-2007, 11:47 PM
Spambot. (http://www.daniweb.com/techtalkforums/thread67582.html)

The answer is that <strong> is semantic, while <b> is visual. <b> just says that the text should be bold, while not giving any reason why that should be the case; <strong> says that this text is intended to be given emphasis. How this is accomplished is up to the user agent, although the tradition has been to make it bold.

jscheuer1
01-26-2007, 11:50 PM
I think strong will win if it can stand being stung by the b. Kidding aside, the modern method is to style this in your stylesheet:


.bold {
font-weight:bold;
}

and use it in your markup like:


<span class="bold">I'm Bold!</span>

This seems like extra work and is for such a single and simple style. However, the way most web pages are designed, much effort can be saved and much modularity can be gained if all style resides in the stylesheet. Multiple styles can be assigned to a class that can be reused over and over in the document and, even (with the use of an external stylesheet) in several documents. If this class' style ever needs to be changed, it can then be changed across the entire site in just one location in just one file.

Twey
01-27-2007, 12:11 AM
the modern method isIt depends as to why the text is being made bold. If it's in order to emphasise the text, <strong> is preferable to <span>. If it's a header, <h1> (or <h2>, or <h3>, or so on) should be used. <span> and <div> are both "generic" elements, that should only be used when there's nothing with semantics that match your intended purpose. Style can be applied to the header or the <strong>, if its being bold doesn't suit one's purpose.

jscheuer1
01-27-2007, 05:30 AM
To answer the original question, there is no difference between <strong> and <b>.

Twey
01-27-2007, 11:05 AM
Huh? I just explained the difference: <b> is presentational while <strong> is semantic.

jscheuer1
01-27-2007, 11:17 AM
But, it makes no difference which you use.

Twey
01-27-2007, 11:52 AM
It leaves you with semantic markup that can be better understood by both humans and digital parsers. This page (http://mpt.net.nz/archive/2004/05/02/b-and-i) explains some of the reasons to use semantic markup and some examples of where it's possible, as well as some where it isn't; however, note that it erroneously recommends using <b> and <i> for those cases where there is nothing semantically closer to the meaning of the text. These days we would, as you said, use a <span> and CSS for those cases.

jscheuer1
01-27-2007, 05:12 PM
I think I will choose to concede this one although, I agree with the author of the article. Why give people the choice when it is more likely that they will choose incorrectly or simply not use it at all due to there being too many choices available?

I didn't even know about dfn and some of those other tags.

Still makes no difference in how it looks (b vs. strong).

Twey
01-27-2007, 06:14 PM
Still makes no difference in how it looks (b vs. strong).Depends on the browser. <b> can be rendered only one way: its contents must be bold (unless otherwise stated in a stylesheet). <strong>, however, can be represented any way that will convey strong emphasis: underline, bold, italics, louder in a screen reader, more prominent for a Braille device...
Why give people the choice when it is more likely that they will choose incorrectly or simply not use it at all due to there being too many choices available?Because the people who wrote web pages originally were under the impression that the people who would write them in the future would know the specification inside out. This, as it turns out, was slightly optimistic of them.

jscheuer1
01-27-2007, 06:31 PM
This, as it turns out, was slightly optimistic of them.

LOL. Slightly?

This is where I came in and so is where I am often 'coming from'. Folks just want things to work and cannot be bothered with minutia. However, I have this oddball part of me the likes minutia (to a point) and an understanding of it can contribute to making things work.

I think we already established elsewhere though that, if one were to devote one's time to completely grasping all of the periodically changing/updating and new standards involved in web design and its many, many optional facets, there would be little or no time left for anything else.

Twey
01-27-2007, 07:20 PM
I think we already established elsewhere though that, if one were to devote one's time to completely grasping all of the periodically changing/updating and new standards involved in web design and its many, many optional facets, there would be little or no time left for anything else.Well, yes, but it is possible (example: Mike). Even we humans can get a reasonable grasp on things by understanding the basic principles behind these changes. Semantic markup is one of those.

techno_race
03-24-2007, 01:05 AM
To most people, there's no difference. I vote <strong>. <b> is deprecated. Probably because screen readers simply ignore it. For emphasis, you want <em> (which usually renders the same as <i>)

If you were to write the above in HTML, it would be:

To most people, there's no difference. I vote &lt;strong&gt;. &lt;b&gt; is deprecated. Probably because screen readers simply ignore it. For emphasis, you want &lt;em&gt; (which <em>usually</em> renders the same as &lt;i&gt;)
and NOT

To most people, there's no difference. I vote &lt;strong&gt;. &lt;b&gt; is deprecated. Probably because screen readers simply ignore it. For emphasis, you want &lt;em&gt; (which <i>usually</i> renders the same as &lt;i&gt;)