Sams Teach Yourself HTML 4 in 24 Hours

Sams Teach Yourself HTML 4 in 24 Hours

By Dick Oliver

Headings

When you browse through Web pages on the Internet, you can't help but notice that most of them have a heading at the top that appears larger and bolder than the rest of the text. Figure 2.6 is a simple Web page, containing examples of the three largest heading sizes you can make with HTML.

02fig06.jpg

Figure 2.6 The <h1>, <h2>, and <h3> tags in Figure 2.5 make the three progressively smaller headings on this Web page.

As you can see in Figure 2.5, the HTML that creates headings couldn't be simpler. For a big level 1 heading, put an <h1> tag at the beginning and an </h1>, tag at the end. For a slightly smaller level 2 heading, use <h2> and </h2> and for a little level 3 heading, use <h3> and </h3>.

02fig05.gif

Figure 2.5 Any text between <h1> and </h1> tags will appear as a large heading. <h2> and <h3> make smaller headings.

Theoretically, you can also use <h4>, <h5>, and <h6> to make progressively less important headings, but nobody uses these very much—after all, what's the point of a heading if it's not big and bold? Besides, most Web browsers don't show a noticeable difference between these and the small <h3> headings anyway.

It's important to remember the difference between a title and a heading. These two words are often interchangeable in day-to-day English, but when you're talking HTML, <title> gives the entire page an identifying name that isn't displayed on the page itself, but only on the window title bar. The heading tags, on the other hand, cause some text on the page to be displayed with visual emphasis. There can only be one <title> per page, but you can have as many <h1>, <h2>, and <h3> headings as you want, in any order that suits your fancy.

You'll learn to take complete control over the appearance of text on your Web pages in Part II, "Web Page Text." Yet headings provide the easiest and most popular way to draw extra attention to some important text.

Share ThisShare This

Informit Network