HTML and CSS Reference
In-Depth Information
Solution
Apply markup in a semantic manner.
Semantic markup
is markup that describes the content it contains, rather than what the
content should look like. This means coding paragraphs with the
p
element, titles with
heading elements, and so on.
Discussion
Sometimes referred to as Plain Old Semantic HTML (POSH), semantic markup
eschews the use of presentational elements like
font
or
table
for layout purposes (see
POSH focuses on content. If you have a paragraph, use
p
. A heading?
h1
. The point is
to use the element that best describes the content.
Become familiar with the changes in HTML5 so that your code remains both semantic
and valid. HTML5 redefined several elements like
b
and
i
(see Recipes
1.9
and
1.10
)
and completely dropped others, like
frame
,
frameset
, and
noframes
. Also gone are
presentational elements and attributes, as shown in
Table 2-1
.
Table 2-1. Sampling of obsolete presentational features in HTML5
Elements Attributes
basefont align
big background
center bgcolor
font border
plaintext cellpadding
s cellspacing
strike height
tt nowrap
u valign
width
See Also
For tips and tricks on how to style semantic markup, read
CSS Cookbook
by Christopher
Schmitt (O'Reilly); visit
http://www.w3.org/TR/html5/obsolete.html
for the full list of
obsolete elements and attributes.