Friday 24th of February 2017 01:53:04 PM

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 | U | V | W | X | Y | Z

Index: O

oblique text: 5.4.1. Fonts with Style
octothorpe (#) preceding ID selectors: 2.3.2. ID Selectors
offsets (see side-offset properties)
Opera
CSS implementation in: 1.3.2. Implementations
padding and: 7.5.4. Padding: Known Issues
padding values, negative: 7.5. Padding
operating system, colors and: 10.5.2. Colors
order sorting: 2.8. The Cascade
ordered lists: 7.7.1. Types of Lists
7.7.2. List Item Images
origin image: 6.2.3.3. Length values
origin sorting: 2.8. The Cascade
origins: 2.8. The Cascade
BODY all the way down to inline elements such as EM and A. Even form elements should be affected by the property, although not all user agents can do this correctly. Also, background-color is not inherited. Its default value is transparent , which makes sense; if an element doesn't have a defined color,
orphans property: 10.8.1. Paged Media
outline properties: 10.5.3. Outlines
overflow: 9.1.4. Content Overflow and Clipping
overflow-clip property: 9.1.4.2. Overflow clipping
overflow clipping: 9.1.4.2. Overflow clipping
overflow property: 9.1.4.1. Overflow
overlapping
elements, altering: 9.5. Stacking Positioned Elements
floated elements, preventing: 8.3.1. Floating: The Details
margins (see collapsing margins)
text, preventing: 8.4.3. Managing the Line Height of Inline Elements
overlining: 4.1.6. Text Decoration
overriding previously declared values: 11.1.3. Case 3: Putting a Magazine Article Online


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.

Figure 7-45, leaving the others to their defaults.Since the default border style is none, no bordersappear on the other three sides of the element.

As you can see, the order of the actual values doesn't reallymatter. The following three rules will yield exactly the same border,as illustrated in Figure 7-47:

H1 {border-bottom: 3px solid gray;}H2 {border-bottom: solid gray 3px;}

Figure 4-55

Figure 4-55. Transforming an H1 element

The advantages are twofold. First, all you have to do is write asingle rule to make this change, rather than having to make changesto the H1 itself. Second, if you decide later toswitch from all capitals to capitalizing the first letter of eachword, the change is even easier, as Figure 4-56shows:

H1 {text-transform: capitalize;}<H1>This is an H1 element</H1>

It's also possible to setwidths for individual sides. This is donein two familiar ways. The first is to use any of the specificproperties mentioned at the beginning of the section, such asborder-bottom-width. The other way is to use valuereplicationin border-width. These are both illustrated inFigure 7-40.

you may use other values; experiment to see what you like best.

6.1.4. Good Practices

You may have noticed that in almost every circumstance, where we set a foreground color, we also set a background color. In general, this is a good idea. Since you don't know what styles a user may have predefined, you don't know how your styles might interact with them. Remember the example where links ended up being white on white? That's the sort of thing we want to avoid.