Friday 03rd of July 2015 08:09:14 AM

Book Home

Cascading Style Sheets: The Definitive GuideSearch this book

Symbols | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T

P {background-color: gray; padding: 10px;}
Figure 6-15

Figure 6-15. Backgrounds and padding

(Padding will be discussed in detail in Chapter 7, "Boxes and Borders".)

The background color of just about any element can be set, fromBODY all the way down to inline elements such asEM and A. Even form elementsshould be affected by the property, although not all user agents cando this correctly. Also,background-color is not inherited. Its default | U | V | W | X | Y | Z

Index: X

x-height: 3.2.2.1. em and ex units
XML (Extensible Markup Language): 1.2.6. Preparing for the Future
display property and: 2.9.1. Why Does the display Property Exist?
selectors in: 2.1.2. Simple Selectors


Symbols | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z


Library Navigation Links

Copyright © 2002 O'Reilly & Associates, Inc. All Rights Reserved.

3.1.2.1. Percentage colors

There are, in fact, four ways to affectRGB color. The first way we'll examine is perhaps the easiestto grasp because it uses percentages. Here's an example:

rgb(100%,100%,100%)

This color declaration sets the level of red to its maximum, blue tomaximum, and green the same. These combine to create white, which is,after all, the combination of all colors. Alternatively, in order to