Paul Ingraham wrote:

So it looks the answer to my original question is, "Yes, to center an image
using css, it really is necessary to wrap it in a block level element with
text-style:center defined." Huh!


No, it isn't. As Nelson suggested, using {display : block; margin : 0
auto;} you're not wrapping the img in anything extra, but rather you are
turning the img itself into a block.



Yep. That do indeed work. I didn't believe it until I tried it, and I'm still not sure I understand it. But it works, and it's clean and simple. I assumed I was missing something basic and I was right. ;-)

So setting the left and right margins as "auto" magically accomplishes
centering... because if they're both auto, then they must be equal, and the
only way to have both left and right margins equal is to center the object.
Sweet.  I did NOT see that coming. Elegant, but not obvious. Exactly what I
was hoping for.

Thanks!  I am only an egg.  This has been a good (and useful) introduction
to the list.

Cheers,
Paul

p.s. I'll buy a beer for the first person who correctly identifies the "egg"
reference. :-)  Of course, you'll have to come to Vancouver for it...



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






Stranger in a Strange Land, OBVIOUSLY.  *rolls eyes*

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

-Noa
*****************************************************
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