Reputation: 23
It is my understanding that the <strong>
and <em>
tags are used because they convey semantic meaning. Do the <b>
and <i>
tags also have a semantic meaning or is their role purely presentational? I thought that CSS should be used for presenting content (e.g. by using font-weight
) so why does HTML5 have bold and italics elements?
Upvotes: 2
Views: 245
Reputation: 25755
Those tags were created in previous versions of HTML but have been re purposed in html 5 with additional semantic meaning.
A very nice article I will quote from is: http://html5doctor.com/i-b-em-strong-element/
Quoting from that source (but with corrections as pointed out by @Alohci) :
- i — was italic, now for text in an “alternate voice”, such as transliterated foreign words, technical terms, and typographically italicized text (W3C:Markup, WHATWG)
- b — was bold, now "representing a span of text to which attention is being drawn for utilitarian purposes without conveying any extra importance and with no implication of an alternate voice or mood, such as key words in a document abstract, product names in a review, actionable words in interactive text-driven software, or an article lede" - http://www.w3.org/International/questions/qa-b-and-i-tags
- em — was emphasis, now for stress emphasis, i.e., something you’d pronounce differently (W3C:Markup, WHATWG)
- strong — was for stronger emphasis, now for strong importance, basically the same thing (stronger emphasis or importance is now indicated by nesting) (W3C:Markup, WHATWG)
Quoting (from https://webmasters.stackexchange.com/questions/27693/should-i-still-use-the-b-tag ) :
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.
Please Also Note (Warning):
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.
References:
Upvotes: 7