IE9 Center Website Issue

mdonhau

New Member
I have designed a website and centered the layout with "<div align="middle">". It works in chrome and firefox but not IE9. What can I do to make this compatible with IE9?

Here's the website: www.nielsonlaw.com

Thanks,
Matt
 

LouTheDesigner

New Member
Hello,

Try adding the following code to your header:

Code:
    <meta http-equiv=”x-ua-compatible” content=”IE=8″>

and then adding this to the very bottom of your .htaccess

Code:
BrowserMatch MSIE best-standards-support
Header set X-UA-Compatible IE=8 env=best-standards-support

This should force IE9 to render as if it were in IE8. IE9 has been really buggy for me, and this eliminates all problems that I've had.

-Lou
 

Big Secz

New Member
Hello,

Try adding the following code to your header:

Code:
    <meta http-equiv=”x-ua-compatible” content=”IE=8″>

and then adding this to the very bottom of your .htaccess

Code:
BrowserMatch MSIE best-standards-support
Header set X-UA-Compatible IE=8 env=best-standards-support

This should force IE9 to render as if it were in IE8. IE9 has been really buggy for me, and this eliminates all problems that I've had.

-Lou


Great info for us casual designers....Will put this in my reference book. Thanks.
 

PixelPusher

Super Moderator
Staff member
My suggestions:

  1. Ditch the align attribute, use css instead. It's much more efficient and more widely compatible.
  2. In your situation, remove the outer div all together. It's not needed.
  3. Use external stylesheets. Link to them in the head of the page.

External Stylesheets
HTML:
...
<head>
<link href="stylesheet_location" type="text/css" rel="stylesheet"/>
</head>
...

Add this to your body_wrapper div:
Code:
div#body_wrapper {
    font-size: 0.71em;
    margin: 35px auto; /* use auto to center. Requires a defined width */
    width: 982px;
}
 

Janja

New Member
What John said, but also don't forget to text-align:center for your body tag. Then you can change your text-align to left again in the body_wrapper.
Otherwise it still might not work in IE.
 
Top