Applies to

all elements

Wednesday 25th of November 2015 07:10:53 AM

by Eric A. Meyer
ISBN 1-56592-622-6
First edition, published May 2000.
(See the catalog page for this book.)

Search the text of Cascading Style Sheets: The Definitive Guide.

Table of Contents

Copyright Page
Chapter 1: HTML and CSS
Chapter 2: Selectors and Structure
Chapter 3: Units and Values
Chapter 4: Text Properties
Chapter 5: Fonts
Chapter 6: Colors and Backgrounds
Chapter 7: Boxes and Borders
Chapter 8: Visual Formatting
Chapter 9: Positioning
Chapter 10: CSS2: A Look Ahead
Chapter 11: CSS in Action
Appendix A: CSS Resources
Appendix B: HTML 2.0 Style Sheet
Appendix C: CSS1 Properties
Appendix D: CSS Support Chart
Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.

H1 {color: maroon;}

Simple, straightforward, and difficult to forget. It doesn'tget much better than that. Here are a few more examples:

H1 {color: gray;}H2 {color: silver;}H3 {color: black;}

Of course, you've probably seen (and maybe even used) colornames besides the ones listed earlier. For example, if you specify:shade of red somewhere between the values for red and is simply rgb(100%,0%,0%),whereas maroon is more like(50%,0%,0%). In order to get a color between thosetwo, you might try this:

H1 {color: rgb(75%,0%,0%);}

This makes the red component of the color lighter than that ofmaroon, but darker than that ofred. If, on the other hand, you wished to create aof the previous paragraph. This is the expected effect.

In a like manner, setting a negative value on the other sides willpull them beyond their normal limits:

<P STYLE="margin: -2em; font-weight: bold;">...

As Figure 7-19 makes abundantly clear, the paragraphhas spilled beyond the edges of the browser window and has not onlypulled up far enough to overlap the end of the previous paragraph,but has also pulled the following paragraph up to overlap its last