WebHeadStart.org is currently in beta. Please pardon our appearance as we work to provide you with the most comprehensive
reference on today's web technologies.
Interested in advertising on WebHeadStart? Become an advertising partner today!
Using XHTML Section Headers
XHTML provides six built-in levels of headers (headings) to help you organize and layout the
contents of your Web page in a structured manner. Here is an example of using XHTML headers:
To organize your Web page using XHTML section headers:
In the body of your XHTML document, go to where you wish to place the section header and type "<hn>", where n
is a number between 1 and 6, which corresponds to the level of the header that you wish to create, for example:
<h1>, <h2>, <h3>, <h4>, <h5>, <h6>
Type the contents of your header.
Type "</hn>" to close the section header, where n corresponds to the same number used in the first step.
Here's what the above XHTML section header example looks like when rendered in a browser:
Code Sample — browser view
XHTML Headers: Tips and Tricks
The higher the level of a header (i.e. the smaller the number), the more prominently
they are displayed on the page. Typically, browsers default to Times New Roman, bold face, at 24, 18,
14, 12, 10 and 8 pixel font, respectively - you can always use a css stylesheet to override these default
settings.
Headers are hierarchical - they give your document structure, like a table of contents.
You can nest them, with bigger headings on the outside, and smaller headings on the inside.
XHTML headings are block-level elements - i.e., their contents automatically start on a new line.