Share this Page URL

Chapter 3. From Buck-Naked to Beautiful:... > A Few Formatting Features You'll Use... - Pg. 29

From Buck-Naked to Beautiful: Dressing Up Your Page 29 Many web designers divide their page contents into several sections, like chapters in a book. To help separate these sections and thus make life easier for the reader, you can use headings. Ideally, headings act as minititles that convey some idea of what each section is all about. To make these titles stand out, HTML has a series of heading tags that display text in larger, bold fonts. There are six heading tags in all, ranging from <H1>, which uses the largest font, down to <H6>, which uses the smallest font. What's with all the different headings? Well, the idea is that you use them to outline your document. As an example, consider the headings I've used in this chapter and see how I'd format them in HTML. The overall heading, of course, is the chapter title, so I'd display it using, say, the <H1> tag. The first main section is the one titled "Sprucing Up Your Text," so I'd give its title an <H2> heading. That section contains three subsections, "Some Basic Text Formatting Styles," "Combining Text For- mats," and "Accessorizing: Displaying Special Characters." I'd give each of these titles the <H3> heading. Then I come to the section called "A Few Formatting Features You'll Use All the Time." This is another main section of the chapter, so I'd go back to the <H2> tag for its title, and so on. Webmaster Wisdom Notice that I force the browser to display a less-than sign (<) by using the character code &lt;, and to display a greater-than sign (>) by using the code &gt;. The following HTML document (look for headings.htm on the CD in this book) shows how I'd format all the section titles for this chapter, and Figure 3.2 shows how they appear in Internet Explorer on the Mac. (Notice that I don't need to use a <P> tag to display headings on separate lines; that's handled automatically by the heading tags.) <HTML> <HEAD> <TITLE>Some Example Headings</TITLE> </HEAD> <BODY> <H1>From Buck-Naked to Beautiful: Dressing Up Your Page</H1> <H2>Sprucing Up Your Text</H2> <H3>Some Basic Text Formatting Styles</H3> <H3>Combining Text Formats</H3> <H3>Accessorizing: Displaying Special Characters</H3> <H2>A Few Formatting Features You'll Use All the Time</H2> <H3>Sectioning Your Page With Headings</H3> <H3>Aligning Paragraphs</H3> <H3>Handling Preformatted Text</H3> <H3>Them's the Breaks: Using &lt;BR&gt; for Line Breaks</H3> <H3>Inserting Horizontal Lines</H3> <H2>Textras: Fancier Text Formatting</H2> <H3>The &lt;FONT&gt; Tag I: Changing the Size of Text</H3> <H3>The &lt;BASEFONT&gt; Tag</H3> <H3>The &lt;FONT&gt; Tag II: Changing the Typeface</H3> <H3>Changing the Color of Your Page Text</H3> <H3>The &lt;FONT&gt; Tag III: Changing the Color</H3> <H3>The Dreaded &lt;BLINK&gt; Tag</H3> </BODY> </HTML>