Prev | Current Page 307 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"

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.
Compatibility
Opera Safari Firefox Internet Explorer
9.2 3.0 2.0 1.3 2.0 1.5 1.0 7.0 6.0 5.5
Full Full Full Full Full Full Full Buggy Buggy Buggy
Internet Explorer version 5.5 (and version 6 in quirks mode) does not support the
centering of a block element that has a specified width by setting its left and right
margins to auto.
In Internet Explorer versions up to and including 6, the left or right margins are
doubled on floated elements that touch their parents??™ side edges. The margin value
is doubled on the side that touches the parent. A simple fix for this problem is to
set display to inline for the floated element.
If the value of the horizontal negative margins are greater or equal to the sum of the
width, padding, and borders of the element, the width of the element effectively
becomes zero.


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