: Should I still use the tag? A while ago I learned to use proper CSS stylesheets on my websites. However, on Wikipedia and eBay and other sites I see the deprecated <b><i> tags
A while ago I learned to use proper CSS stylesheets on my websites. However, on Wikipedia and eBay and other sites I see the deprecated <b><i> tags being used. I was going for <span style="font-weight:bold;"></span> but I never see it done that way.
So what's up with the WC3 standards. Are <b> tags back in style?
More posts by @Twilah146
3 Comments
Sorted by latest first Latest Oldest Best
@Su is correct, but to address @Konrad 's comment - W3.org (home of the W3C) answers this question directly
The HTML5 specification redefines b and i elements to have some
semantic function, rather than being purely presentational. However,
the simple fact that the tag names are 'b' for bold and 'i' for italic
means that people are likely to continue using them as a quick
presentational fix.
and
You should always bear in mind that the content of a b element may not
always be bold, and that of an i element may not always be italic. The
actual style is dependent on the CSS style definitions. You should
also bear in mind that bold and italic may not be the preferred style
for content in certain languages.
You should not use b and i tags if there is a more descriptive and
relevant tag available. If you do use them, it is usually better to
add class attributes that describe the intended meaning of the markup,
so that you can distinguish one use from another.
The rest of this article will explain this in more detail.
The b and i tags are not deprecated. (In specs: HTML5, HTML4) What you're concerned with is appropriate use of the tags.
If you're trying to show emphasis in a meaningful sense(as now), then you should use em or strong.
If you just need some text to look italic/bold as a stylistic choice, then you use i or b. Consider the logo right here at top of the site, which is effectively "Pro Webmasters". The bolding doesn't serve any "meaningful" purpose; you don't even read it with any different emphasis. It's only there so the words are a bit more easily differentiated. (Addendum: As @toomanyairmiles brings up, HTML5 does overload b and i with some semantic intent, though it can also occur separately from stylistic use, which isn't exactly my favorite implementation.)
As far as I know it's not going against standards to use the <b> or <i> tags on a website. If you think about it, if a user can't load CSS styles on their browser of choice then how will they differentiate between bold text or italic text without the use of the tags?
I know somewhere that they recommended using <strong> tags instead of <b> tags, but no where have I seen anyone say <b> and <i> aren't standards compliant.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.