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
Printable View
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
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.
Spambot.
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.
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:
and use it in your markup like:Code:.bold {
font-weight:bold;
}
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.HTML Code:<span class="bold">I'm Bold!</span>
It 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.Quote:
the modern method is
To answer the original question, there is no difference between <strong> and <b>.
Huh? I just explained the difference: <b> is presentational while <strong> is semantic.
But, it makes no difference which you use.
It leaves you with semantic markup that can be better understood by both humans and digital parsers. This page 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.
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).