Prev | Current Page 299 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"

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. This will effectively center the element in the
available space.
If margins are over-constrained??”that is, the total of their specified dimensions is
greater than the available content space??”the browser will reset one of the margins
to auto to overcome the problem.


Pages:
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311