开发者

Weird quirks mode problem

On my pc the website I develop looks fine in IE, but on web server the layout is "broken" (IE)

开发者_开发问答

Here is my doctype

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

On localhost document Mode is IE8 Standarts

On web server it is: Quirks

Here is code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
        <style type="text/css" media="screen">
            body{
                font: 11px Tahoma, Verdana, Arial, sans-serif;
                color: #707070;
                background: #8c2727 url('../img/bgr_red.png') repeat-x;
            }

            a {
                color:#bc2828;
                text-decoration:none;
                font-weight: bold;
                outline: none;
            }


            #wrapper{
                position: relative;
                width: 960px;
                margin: 70px auto;
                background-color: #fff;
                border: 1px solid red;
            }

        </style>
    </head>

    <body>
    <div id="wrapper">
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
    </div>
    </body>
    </html>

Is it happens to me for the first time. How to fix that ?


You are missing the mode switching meta tag that I recommended in my answer to your last question.

<meta http-equiv="X-UA-Compatible" content="IE=edge"> 

Also the Doctype in your code is different to the Doctype you said you were using (both should still trigger Standards mode, but it is very difficult to debug when what you do and what you say you do are different things!!).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜