2012-09-03 115 views
0

我有一個HTML選項卡CSS,它可以在Chrome和Firefox中正確顯示,但不能在Internet Explorer中顯示。這裏HTMLTabs CSS在Firefox和Chrome中工作,但不在Internet Explorer中

問題是,li與內容結合點分離,並在Internet Explorer

CSS是不加入:

#header ul { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
} 

#header li { 
    float: left; 
    font: 10px arial,sans-serif; 
    border: 1px solid #bbb; 
    border-bottom-width: 0; 
    margin: 0; 
} 

#header a { 
    text-decoration: none; 
    display: block; 
    background: #eee; 
    padding: 0.24em 1em; 
    color: #00c; 
    width: 8em; 
    text-align: center; 
} 

#header a:hover { 
    background: #ddf; 
} 

#header #selected { 
    border-color: black; 
} 

#header #selected a { 
    position: relative; 
    top: 1px; 
    background: white; 
    color: black; 
    font-weight: bold; 
} 

#content { 
    border: 1px solid black; 
    clear: both; 
    padding: 0 1em; 
} 

HTML:

<div id="tabs"> 
    <div id="header"> 
     <ul> 
      <li name_id="tab1" id="selected"> 
      <a name="" type="hyperlink" href="#">tab1</a> 
      </li> 

      <li name_id="tab2"> 
      <a name="" type="hyperlink" href="#">tab2</a> 
      </li> 
     </ul> 
    </div> 
    <div id="content"> 
     <div id="table-wrapper"> 
      <div id="table-scroll"> 
       <table width="100%"> 
        <tbody> 
         <tr> 
          <td> 
           <a href="#">Test Value 1</a> 
          </td> 
         </tr> 
         <tr> 
          <td> 
           <a href="#">Test Value 2</a> 
          </td> 
         </tr> 
        </tbody> 
       </table> 
      </div> 
     </div> 
    </div> 
</div>​ 

jsfiddle.net demo

+0

同樣的問題我:P – bungdito

+1

你可以嘗試添加CSS復位第一:http://meyerweb.com/eric/tools/css/reset/ –

+1

@bungdito看看傑塞爾的下面,它幫助 –

回答

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

在您的html腳本中包含上述DOCTYPE聲明。

+0

雖然上述失蹤但它並沒有幫助解決方案 –

+0

感謝John的快速響應,它在固定字體大小後得到解決。 –

+0

自1999年以來,新的網頁無法使用該文檔。始終使用嚴格的文檔類型。 – Rob

0

我有相同的問題,並解決如果通過將我的字體大小設置爲小閱讀此。奇怪的!

相關問題