小编Poi*_*dow的帖子

nth-child在IE7/IE8中不起作用

我无法让:nth-child选择器与IE7/8一起使用.

这是我的代码的一个工作示例(在Chrome中有效)

下面是我使用的CSS和HTML:

CSS:

#price-list {
    width:98%;
    padding:1%;
    border:white 1px solid;
    margin:0 auto;
    overflow:hidden;
}        
#price-list h4 {
    padding-top:20px; 
    font-weight:400;  
    padding-bottom:5px;
}        
#price-list ul { 
    width:100%; 
    margin-bottom:10px; 
    overflow:hidden; 
}      
#price-list li{
    line-height:1.5em;
    border-bottom:1px  dashed #C9F;
    float:left;
    display:inline;
    padding-top:5px; 
    padding-bottom:5px;
    text-align:center;          
}        
#price-list li strong { 
    color:#C9F; 
    font-weight:normal;
}        
#double-taxi li:nth-child(odd) { 
    width:80%;
    text-align:left; 
}
#double-taxi li:nth-child(even) { 
    width:20%;
}
Run Code Online (Sandbox Code Playgroud)

HTML:

<div id="price-list">
   <ul id="double-taxi">            
      <li><h4>North Goa</h4><strong>(Distance kms)</strong></li><li><h4>Non A/C</h4>Rs <strong>(UK &pound;)</strong></li>
      <li>Aldona <strong>(10 kms)</strong></li><li>250 Rs <strong> (&pound;3)</strong></li>
      <li>Asnora …
Run Code Online (Sandbox Code Playgroud)

css internet-explorer css-selectors css3

6
推荐指数
2
解决办法
2万
查看次数

标签 统计

css ×1

css-selectors ×1

css3 ×1

internet-explorer ×1