Paul,

Before you jump for joy at this solution you should be aware that it is not
supported across older browsers like the Netscape4's and IE4's. More
importantly, it is not supported in Win/IE5 or Win/IE5.5. This may not be an
issue.

For more details, take a look at this:
http://www.browsercam.com/public.aspx?proj_id=61584

To answer your earlier question - 'why do display block and auto margins
work' (generally)...

1. By default, images are treated as inline elements. This means they need
to be converted to a block level element in order for margins to take effect
correctly.

2. As you guessed, left and right margins set to zero will cause the element
to be centered. The W3C Visual formatting model states: "If both
'margin-left' and 'margin-right' are 'auto', their used values are equal.
This horizontally centers the element with respect to the edges of the
containing block."
http://www.w3.org/TR/CSS21/visudet.html#blockwidth

Russ


>> That's a great trick, too.. simplicity all the way.

*****************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
***************************************************** 

Reply via email to