HTML and CSS Reference
In-Depth Information
So, instead of removing either
<b>
or
<i>
,
HTML5
redefines and reha-
bilitates them.
Element
HTML4 definition
HTML5 definition (taken from the spec on May 12, 2010)
Renders as italic
text style
“The i element represents a span of text in an alternate voice
or mood, or otherwise offset from the normal prose, such as a
taxonomic designation, a technical term, an idiomatic phrase
from another language, a thought, a ship name, or some other
prose whose typical typographic presentation is italicized.”
<i>
Renders as bold
text style
“The b element represents a span of text to be stylistically offset
from the normal prose without conveying any extra importance,
such as key words in a document abstract, product names in a
review, or other spans of text whose typical typographic presen-
tation is boldened.”
<b>
As you can see, the
HTML4
definition is entirely presentational,
whereas the
HTML5
definition goes to great lengths to give a semantic
meaning while remaining compatible with the purely presentational
uses of the two elements for backward compatibility.
HTML5's new global attributes
An attribute is
global
if it can be applied to all elements. The two most
obvious global attributes in
HTML4
are
id
and
class
, which, as you saw
in the section “Why do we need new elements?” can be used to add