Tuesday, September 14, 2010

Paragraphs and headings

With words making up the bulk of online content, the paragraph and heading HTML elements
are of paramount importance. HTML provides six levels of headings, from h1 to h6,
with h1 being the top-level heading. The adjacent image shows how these headings, along
with a paragraph, typically appear by default in a browser.
<h1>Level one heading</h1>
<h2>Level two heading</h2>
<h3>Level three heading</h3>
<h4>Level four heading</h4>
<h5>Level five heading</h5>
<h6>Level six heading</h6>
<p>Default paragraph size</p>
By default, browsers put margins around paragraphs
and headings. This can vary from browser to
browser, but it can be controlled by CSS. Therefore,
there’s no excuse for using double line breaks to
avoid default paragraph margins affecting web
page layouts.
Despite the typical default sizes, level-five and level-six headings are not intended as “tiny
text,” but as a way to enable you to structure your document, which is essential, as
headings help with assistive technology, enabling the visually disabled to efficiently surf
the Web.
In terms of general usage, it’s generally recommended to stick to just one h1 element per
document, used for the page’s primary heading. The next level down—and the first level
in a sidebar—would be h2, and then h3, and so on. Take care not to use too many heading
levels, though—unless you’re working on complex legal documents, you really shouldn’t
be getting past level four. If you are, look at restructuring your document.

No comments:

Post a Comment