IE9 Center Website Issue

Discussion in 'Web Design' started by mdonhau, Jun 28, 2011.

to remove all ads.
  1. mdonhau

    mdonhau New Member

    Messages:
    1
    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
     
  2. LouTheDesigner

    LouTheDesigner New Member

    Messages:
    510
    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
     
  3. Big Secz

    Big Secz New Member

    Messages:
    8

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

    PixelPusher Super Moderator

    Messages:
    1,092
    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;
    }
    
     
  5. Janja

    Janja New Member

    Messages:
    65
    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.
     

Share This Page