Sunday 04th of December 2016 04:52:25 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 | U | V | W | X | Y | Z

Index: Y

There are no index entries for this letter.

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

Using any one of these properties allows you to set a margin on thatside only, without directly affecting any of the other margins.

It's possible to use more than one of these single-sideproperties in a single rule; for example:

H2 {margin-left: 3em; margin-bottom: 2em; margin-right: 0; margin-top: 0;}

As we see in Figure 7-15, the margins were set as wewanted them.

| U | V | W | X | Y | Z

Library Navigation Links

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

Opera 3.6. More than one auto

Now let us consider the cases where two of these three properties areset to auto. If both the margins are set toauto, then they are set to equal lengths, thuscentering the element within its parent, as you can see from Figure 8-14: TYPE; in the case of a CSS1 document, the correctvalue is text/css, just as it was withthe LINK tag. So, the STYLEcontainer should always start with <STYLETYPE="text/css">. This is followed by one ormore styles and finished with a closing</STYLE> tag.

The styles between the opening and closingSTYLEthe result in Figure 7-38 as follows:

As we can see in Figure 7-41, despite the fact that the border's width was set to be 20px , when the style is set to none, not only does the border's style go away, so does its width! Why?

If you'll remember, the terminology used in the previous section was that a border with a style of none does not exist. Those words were picked carefully because they help was discussed earlier in "Margins: Known Issues." Therefore, if you have a background color, some padding, and a border set for an element, you'll see the background fill the content area and the padding as requested, but a transparent space will incorrectly appear between the two, as shown in Figure 7-62.

Figure 7-62

Figure 7-62. Padding problems in Navigator 4

This may be an interesting effect, but it isn't permissible under the CSS specification, and no other browser will do the same thing, so it's best to avoid this altogether.