Someone suggested I use
instead ofCode:<strong>
Does it make any difference?Code:<b>
Thanks
| SitePoint Sponsor |




Someone suggested I use
instead ofCode:<strong>
Does it make any difference?Code:<b>
Thanks
Hi ChrisJChrisJ,
Interesting question.
Already a bit of information here:
http://www.webmasterworld.com/forum21/9344.htm
My understanding has always been that
<b> is to make an element look bold (now superceded by CSS <span style="font-weight:bold">bold!</span>
<strong> is used to emphasise the context within, for example, speach recognition software but for display purposes is renders the same as <b>.
I always use CSS for any style enhancement including bold. Not sure if I'm missing an SEO opportunities by doing that or if there's any other advantage.
So, for me CSS, then <b>, then <strong> but as I say, interesting question.
Regards,
David
The <b> and <i> elements have semantic meaning according to context and typographic convention. For example, in an article about people, it is convention to make bold the first instance of a name. Convention also calls for ships' names to be bold. Book titles used to be bold, but are more commonly italic now. These are not presentational; the bold says "I'm a person's name", or "this is a ship". Likewise, the italic says "this is a book". The meaning is dependent on context, but it is a semantic value, just as <p> defines a paragraph, or <h1> a top level heading.
The <b> is not related semantically to <strong>, and css does not impart a semantic value where <b> or <strong> should be used (though you're free to style either element).
cheers,
gary
Anyone can build a usable website. It takes a graphic
designer to make it slow, confusing, and painful to use.
Simple minded html & css demos and tutorials

<span style="font-weight:bold"> may have the same result as <b> but it has a totally different meaning.
In most cases where <span style="font-weight:bold"> would be applicable what you really mean is <strong> because in most cases making something bold is intended to apply strong emphasis to it. Using <strong> to apply emphasis rather than <span style="font-weight:bold"> is better because that will also work when CSS is turned off and with media such as webreaders where there is nothing written to make bold.
<b> as already indicated has an entirely different meaning of being a person or ship's name and has nothing whatever to do with emphasis. You need to understand the typographical conventions used in the specific field you are writing about to be able to know what semantically belongs inside <b> tags.
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">




It makes a significant difference and hence why the <B> element is not deprecated in HTML and typically if you want to make darker text/typography you'd use CSS.
If you want to emphasis you use <EM> and for Strong Emphases <STRONG> note <B> just (typically) renders bold text; you cannot speak in an italicised or bold style. Albeit you can speak in an emphasis form.
};-) http://www.xhtmlcoder.com/
Thinking Web: Voices of the Community
> March 2013 - SitePoint forums: Spot the Error 3: Calling all Sleuths! Winner Announced!... She knows how to spot simple <code> errors but do you?

The following is a perfectly valid use of <b> for which no alternative in HTML exists (unless you were to code <span class="shipname"> instead - which isn't necessary when an HTML tag with that meaning exists as is the case since anyone involved with ships knows that typographically ship names are written in bold text as a specific typographical convention).
HTML Code:<p>The ship <b>Queen Elizabeth II</b> pulled into the dock.</p>
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">


The convention for ship names is that the name be marked as bold. The <b> tag is therefore the correct one in that instance since iit indicates the ship name. How that appears in the web browser is determined by the CSS which has nothing to do with what tag is used in the HTML. Just reading the HTML source makes it clear what is what.
Since the only use for the <b> tag is this one and other similar typographical conventions in other fields there would be no use for the <b> tag at all if it were not for instances like this one.
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">

Right, but the only reason why the b or sometimes i tag are used, is because of the presentational value.
Lets say the b or i tag values in all cases = font-weight/font-style normal(which it clearly doesn't), then what purpose would the b or i tag be utilized for?
This typographic convention is primarily based off of presentational values.
P.S
Not many people look in the html markup, and if so, bold conveys its presentational value and not the intended meaning of the text.

yes but the typographical convention still gives a semantic meaning to the tags when applied that way and is the only time that bold and italic ever have a semantic meaning. That the reason for that semantic meaning is based off of a presentational effect doesn't invalidate the semantics of specifying it that way. After all the bold or italic in those cases are not applying emphasis and so strong and em are not substitutes for them in those cases. Rhe only other way you could specify it would be with a span tag and a class but why do that when a separate tag with the same semantic meaning exists in HTML.
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">


Hmmm, <b> and <i> are within a Presentation Module; in either case generally speaking a ships name is typographically written with <I> rather than <B>.
Off Topic:
Now, if you were referencing her, and her name and actions; Regalskeppet Vasa you would use the <cite> element.
};-) http://www.xhtmlcoder.com/
Thinking Web: Voices of the Community
> March 2013 - SitePoint forums: Spot the Error 3: Calling all Sleuths! Winner Announced!... She knows how to spot simple <code> errors but do you?

True, and this way would fail with css disabled(the span method that is). This in my mind is the main reason why the b tag still stands for cases as we've discussed.
Although, I wouldn't push the theory that the b tag(in any case) has any sort of semantic value.
I would right this off as a presentational must... hehe

Just because it's been abused for the wrong reasons does not mean it should be abandoned, the b and i elements do have semantic value. The bold element should be used to highlight key words or phrases that relate to the document but have no inherent emphasis or strength behind them. Italics of course are mainly used for names of objects, people and word definition references (at least they are in my book). I entirely agree that they still have a valid semantic purpose.![]()
Bookmarks