Friday, 1 March 2013

Adding More Semantic Meaning | HTML5 Tutorial pdf

Adding More Semantic Meaning

Problem
You want to markup content correctly.
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 Markup (POSH), semantic markup eschews presentational elements like font or table for layout (see http://microformats.org/wiki/posh).
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 and completely dropped others, like frame, frameset and noframes.
Also gone are presentational elements and attributes, as shown in Table.
Table: 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

No comments: