Prev | Current Page 80 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"

If only a single value is specified, it??™s applied to all four sides.
Take a look at this declaration:
margin: 1em 2em 3em;
That??™s equivalent to these:
margin-top: 1em;
margin-right: 2em;
margin-bottom: 3em;
margin-left: 2em; /* same as margin-right */
In the same vein, consider this declaration:
margin: 1em 2em;
It??™s the same as these:
margin-top: 1em;
margin-right: 2em;
margin-bottom: 1em; /* same as margin-top */
margin-left: 2em; /* same as margin-right */
This form of shorthand notation is used for the properties: margin (p. 209), padding
(p. 218), border-width (p. 254), border-color (p. 249), and border-style (p. 251).
41 General Syntax and Nomenclature
Shorthand for Other Properties
A somewhat different form of shorthand notation allows us to specify a number of
related properties at once. For example, we can combine multiple background-related
properties into one background declaration:
background: #fff url(bg.png) no-repeat fixed right top;
This declaration is equivalent to the following:
background-color: #fff;
background-image: url(bg.


Pages:
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92