The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Center elements inside of a container Re: Center elements inside of a container


Your code looks ok. When I position my container to be centered, I always like to add a position relative in there with the margin:0 auto; and the width.

I think your IE problem is not the original width of your box class, it’s the margins and paddings. you should change your conditional comment not to shrink the width of the box, but the margin. IE always doubles the margins on floats. Try putting 5px for your margin and see if you get any results.