Page 1 of 1

Centering in Firefox vs IE vs Opera

Posted: Mon Feb 16, 2009 2:20 pm
by UMGuide
Below is a website to illustrate the problem, but I have several such websites:
http://iwin123.com/

If you look below the menu (where the car is at the top) you'll see how the site transitions from the header to the "main content". In Firefox it is perfect. In Opera and IE it is off by 1px. The background image (which contains the borders and the "white section" is set to be centered via CSS. The header is set to be centered also. BUT, firefox and IE center it differently by 1px so either it is off in firefox or it is off in IE. Any idea of a way to fix this within CSS so that it is centered perfectly in both IE, Firefox and Opera?

Much thanks,
Chris

Re: Centering in Firefox vs IE vs Opera

Posted: Fri Feb 20, 2009 5:34 am
by JAB Creations
style.css

Code: Select all

.center
{
margin-left: auto;
margin-right: auto;
text-align: center;
}
Do not float, if necessary create another div element to float content inside of the centered element. Margins for block, text-align for inline elements.