Muzammil
Muzammil

Reputation: 508

Margin in IE is not working

I have created a free report and it is working too fine in mozilla firefox but having alot of issues in MS IE.

Please give me any solution for this please.

Here is the link of the website which is looking messed up in IE.

http://www.getsuperiorreturnsnow.com/

i set its main #container

#container {
   width: 840px;
   margin: 10px auto;
   display: block;
}

but not working. :(

Upvotes: 1

Views: 5755

Answers (2)

T. Junghans
T. Junghans

Reputation: 11683

IE is displaying your page in Quirksmode which is why margin: auto will not work.

You can check if IE is running in Quirksmode by reading the answer on this post: How to tell if a browser is in "quirks" mode?

You'll find a list of IE Quirksmode limitations here: http://www.quirksmode.org/css/quirksmode.html

You will need to change your Doctype to make IE run in strict mode. For example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Upvotes: 2

harry
harry

Reputation: 731

For IE6 you're going to want to add text-align: center; to the element parent to the container which you are using margin: auto;

For example if you had:

<body>
<div id="wrap">

You could try:

body {text-align: center;}
#wrap {width: 1000px; margin: auto;}

Upvotes: 0

Related Questions