Centering in Firefox vs IE vs Opera

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
UMGuide
Forum Newbie
Posts: 2
Joined: Tue Jan 27, 2009 10:53 am

Centering in Firefox vs IE vs Opera

Post 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
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: Centering in Firefox vs IE vs Opera

Post 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.
Post Reply