2012-09-03 110 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

我有相同的问题,并解决如果通过将我的字体大小设置为小阅读此。奇怪的!

相关问题