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
Style Properties
The following list explains everything that you can reliably do with style sheets if you want to stay compatible with Microsoft Internet Explorer 3 or later and Netscape Navigator 4 or later. The CSS1 standard includes a number of additional formatting options, some of which are supported by version 5 browsers. I didn't include those here since a great many people today are still using version 4 browsers, but you can find the complete CSS1 specification online at http://www.w3c.org.
- font: Lets you set many font properties at once. You can specify a list of font names separated by commas; if the first is not available, the next is tried, and so on. You can also include the words bold and/or italic and a font size. Each of these font properties can be specified separately with font-family:, font-size:, font-weight: bold, and font-style: italic if you prefer.
- line-height: Also known in the publishing world as leading. This sets the height of each line of text, usually in points.
- color: Sets the text color, using the standard color names or hexadecimal color codes (see Hour 11, "Custom Backgrounds and Colors" ).
- text-decoration: Useful for turning link underlining off—simply set text decoration to none. The values of underline, italic, and line-through are also supported.
- text-align: Aligns text to the left, right, or center (just like the <div align> HTML attribute). The CSS1 standard allows a value of justify for text aligned to both the left and right margins, but current version browsers do not display full-justified text reliably.
- text-indent: Indents beyond the left margin by a specified amount. You can say how far to indent in units (px, in, cm, mm, pt, pc), or you can specify a percentage of the page width (such as 20%).
- margin: Sets the left and right margins to the same value, which can be in measurement units or a percentage of the page width. Use margin-left: and margin-right: if you want to set the left and right margins independently, and margin-top: to set the top margin.
- background: Places a color or image behind text, either with a color or an url( address ) where address points to a background image tile. Note that this can be assigned not only to the <body> tag, but to any tag or span of text to "highlight" an area on a page. (Also note that it doesn't always work quite right in Microsoft Internet Explorer 3, although it generally works fine in version 4 browsers.)
Style Classes | Next Section

Account Sign In
View your cart