Sams Teach Yourself HTML 4 in 24 Hours
- Table of Contents
- Copyright
- About the Author
- Acknowledgments
- Tell Us What You Think!
- Put Your HTML Page Online Today
- I. Your First Web Page
- Hour 1. Understanding HTML and XML
- Hour 2. Create a Web Page Right Now
- Hour 3. Linking to Other Web Pages
- Hour 4. Publishing Your HTML Pages
- II. Web Page Text
- Hour 5. Text Alignment and Lists
- Hour 6. Text Formatting and Font Control
- Hour 7. Email Links and Links Within a Page
- Hour 8. Creating HTML Forms
- III. Web Page Graphics
- Hour 9. Creating Your Own Web Page Graphics
- Hour 10. Putting Graphics on a Web Page
- Hour 11. Custom Backgrounds and Colors
- Hour 12. Creating Animated Graphics
- IV. Web Page Design
- Hour 13. Page Design and Layout
- Hour 14. Graphical Links and Imagemaps
- Hour 15. Advanced Layout with Tables
- Hour 16. Using Style Sheets
- V. Dynamic Web Pages
- Hour 17. Embedding Multimedia in Web Pages
- Hour 18. Interactive Pages with Applets and ActiveX
- Hour 19. Web Page Scripting for Non-Programmers
- Hour 20. Setting Pages in Motion with Dynamic HTML
- VI. Building a Web Site
- Hour 21. Multipage Layout with Frames
- Hour 22. Organizing and Managing a Web Site
- Hour 23. Helping People Find Your Web Pages
- Hour 24. Planning for the Future of HTML
- VII. Appendixes
- A. Readers' Most Frequently Asked Questions
- B. HTML Learning Resources on the Internet
- C. Complete HTML 4 Quick Reference
- D. HTML Character Entities
Choosing a Typeface
With the 3 and 4 versions of both Navigator and Internet Explorer, Netscape and Microsoft have added another extremely powerful form of font control: the <font face> attribute. This allows you to specify the actual typeface that should be used to display text—and has been the source of much rejoicing among Webmasters who are awfully sick of Times and Courier!
The page in Figures 6.3 and 6.4 uses these font controls to present a quick but colorful history lesson. Notice how <font> tags can be nested inside one another, changing some aspects of the font's appearance while leaving others the same; for example, even when <font> tags change the size and color of the letters in A HISTORY OF EVERYTHING, the typeface specified in the first <font> tag still applies. Likewise, the <font> tags that make small capital letters do not change the color, so the entire line ends up maroon.
Figure 6.4 If you have the Lucida Sans Unicode and Lucida Sans fonts installed on your computer, they will be used to display the page. Now look at Figure 6.5.
The following is the code to set the typeface used for most of the text in Figure 6.3:
<font face="lucida sans unicode, arial, helvetica">
If Netscape Navigator or Microsoft Internet Explorer can find a font named Lucida Sans Unicode on a user's system, that font is used. Otherwise, the browser will look for Arial or Helvetica. Figure 6.5 shows how the page would look on a computer that didn't have Lucida Sans Unicode or Lucida Sans installed, but did have the Arial font.
Figure 6.5 If you didn't have Lucida Sans Unicode and Lucida Sans fonts installed, the text from Figure 6.3 would appear in Arial, if available, or in the default font, which is usually Times New Roman.
If none of those fonts could be found, the browser would display the text using the default font (usually Times New Roman). Most browsers other than Navigator and Internet Explorer will ignore the font face attribute and display the fonts they always use.
Since only fonts that each user has on his system show up, you have no real control over which fonts appear on your pages. Furthermore, the exact spelling of the font names is important, and many common fonts go by several slightly different names. This means that about the only truly reliable choices are Arial (on Windows machines) and Helvetica (on Macintoshes). Don't be afraid to specify other fonts, but make sure your pages look acceptable in Times New Roman as well.
You'll find many additional tips on using typefaces in Hour 16.
Special Characters | Next Section

Account Sign In
View your cart