Prev | Current Page 310 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"

1.
Negative values are allowed for margins (although implementation-specific limits
may apply), and have the effect of pulling the element in the direction of the margin
specified. This may cause the element to overlap other elements, which may, of
course, be the desired effect. In cases where overlap occurs, we can determine the
elements??™ stacking levels by applying z-index values to them. In the case of
non-positioned or floated elements, a z-index only takes effect when a position is
set to relative for the elements, as a z-index can be applied only to positioned
elements.
Negative margins on floats are handled differently and the details are covered in
Floating and Clearing (p. 180).
When you use the value auto, you??™re allowing the browser to calculate the margins
for you automatically. In most cases, the calculated value will default either to zero
or to the distance required to reach the parent element??™s edge. In the case of a block
element that has a specified width, left and right margins to which a value of auto
is applied will be set to be equal.


Pages:
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322