HTML Cookbook Basic HTML Course

It's Easy!

Alternate version

Headings

Headings are used as section titles on a web page.

Headings appear in bold text with a blank line before and after. They come in 6 sizes, with size 1 being the largest.

Heading Form: <hn> text </hn>

Replace n with a number from 1 to 6. The number that is the opening tag must be the same in the closing tag.

Here are the 6 heading tags:

<h1> text </h1>
<h2> text </h2>
<h3> text </h3>
<h4> text </h4>
<h5> text </h5>
<h6> text </h6>

Here is what they look like in action (my h1 is centered in my stylesheet)

This is heading size 1

This is heading size 2

This is heading size 3

This is heading size 4

This is heading size 5
This is heading size 6

Heading 1 is used by indexers to describe a page.

Heading level 1 should only be used for your page title. The others headings on the same page should be smaller (2-6).

Sections of your page that have the same level of importance should use the same size heading.

Heading attribute: align="..."
You may use "left", "center" or "right" to position headings on the screen. The default is "left".

Happy coding!
Gnubee

Links
Tips
Tools
References
Rules
HTML Help Gnubee - Newsgroup
HTML Course Contents (Home)

Valid XHTML 1.0!

Valid CSS!