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


Wow thanks a lot for the tips, I didn’t know them. The display: inline; method works perfectly if I use pixels. However if I use ems it’s completely useless. I tried to reduce the margin with a conditional comment but it only works partially: The boxes are aligned but not centered. But what is really confusing is that depending on the version of IE the margins are different. In IE 6 I managed to center the content with a margin of 0.8em, but for IE 7 and IE 8 it seems impossible to center the content perfectly with this method. The biggest value that I can set for the margin so that the boxes are still aligned is 0.95em (with 0.96em the boxes aren’t aligned anymore) and the boxes are not perfectly aligned (there is more space on the right then on the left) :?
Is there also a hack for this?
The specific page I’m talking about is this one