2011-04-06 97 views
0

在我的電腦網站,我發展看起來不錯的IE瀏覽器,但Web服務器上的佈局是「破」(IE)奇怪的怪癖模式問題

這裏是我的doctype

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

在本地主機上的文件模式是IE8 Standarts

在網絡服務器,它是:怪癖

這裏是代碼:

<!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> 

這是第一次發生在我身上嗎?如何解決這個問題?

+2

該網站的URL可以更容易地識別發生了什麼 – Quentin 2011-04-06 09:29:11

+0

@David Dorward我編輯了我的帖子。往上看。 – prista 2011-04-06 09:56:56

+0

那麼...終於哪一個是你實際使用的文檔類型? :) – kapa 2011-04-06 10:11:37

回答

1

你缺少mode switching meta tagI recommended in my answer to your last question.

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

而且在DOCTYPE在你的代碼是不同對你說你正在使用(兩者都應該依舊會觸發標準模式的文檔類型,但它是非常困難的調試什麼時候你做什麼和你說什麼是不同的東西!!)。

+0

Dorward, 請按照這個線程http://stackoverflow.com/questions/5565349/somehow-php-broke-doctype – prista 2011-04-06 11:11:02