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:
<h1>The 2004 Baseball ALCS Players Roster</h1>
<h2>Boston RedSox</h2>
<h3>Bronson Arroyo</h3>
<h3>Tim Wakefield</h3>
...
<h2>New York Yankees</h2>
<h3>Derek Jeter</h3>
<h3>Alex Rodriguez</h3>
...
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.
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.