使第一子和最后子在IE8中工作
Make first-child and last-child work in IE8
在我的项目中,我正在尝试使用selectivizr
使以下css在IE8中工作thead>tr:first-child>th:last-child {
color: red;
}
tbody>tr:first-child>td:last-child {
color: red;
}
根据Selectivizr网站的描述,我在JSFiddle的External Resources中添加了以下代码:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<!--[if (gte IE 6)&(lte IE 8)]>
<script type="text/javascript" src="https://github.com/keithclark/selectivizr/blob/master/selectivizr.js"></script>
<noscript><link rel="stylesheet" href="[fallback css]" /></noscript>
<![endif]-->
我仍然不能使first-child
和last-child
伪选择器在IE8中工作。
我正在使用以下代码将所有版本的IE切换到IE8。(仅供参考)。
<meta http-equiv="X-UA-Compatible" content="IE=8" >
这个选择器在IE8中不支持,所以你可以为第一个和最后一个元素指定id或特殊类。例如:
<tr class="thisSection">
<td class="customClass firstTD">1</td>
<td class="customClass">2</td>
<td class="customClass">3</td>
<td class="customClass lastTD">4</td>
</tr>
我最终做了以下事情,因为我有固定的列
thead>tr:first-child>th:first-child+th+th+th {
color: red;
}
tbody>tr:first-child>td:first-child+td+td+td {
color: red;
}
我这样做是因为first-child
支持IE8,但不支持last-child
。
在IE8下运行正常
来源无论如何,我仍然不知道如何使用selectivizr project.
相关文章:
- IE8更改文本区域上的事件侦听器不工作
- window.onbeforeunload在IE8中不触发(在Firefox,Chrome和Safari中工作正常)
- $('body').on('blur')在IE8中工作不好
- window.location重定向没有'我不在IE8上工作
- addEventListener没有'不能在IE中工作(在IE8中测试)
- Requirejs和主干应用程序,不能在IE8中工作
- 无法在 IE 9 中传递此运算符的值,而它在 IE7 和 IE8 中工作正常
- Request.UrlReferrer在IE8中无法正常工作,并且工作正常IE9
- 不触发 OnClick 事件 IE8,但在 Firefox 中工作正常
- 如何优化我的jQuery以始终在IE8中工作,目前它被击中和错过
- 获取尾随逗号(在JavaScript中)在IE7 / IE8中工作
- FormData ajax 上传 IE8 -> 替代品及其工作原理
- jquery设置隐藏的输入值在IE7和IE8中未按预期工作
- 代码不'我不在IE8工作
- IE7中没有填充mootools中的动态下拉列表.IE8工作良好
- 梅森不在IE8工作
- Youtube iframe API调用以播放视频/pauseVideo don'我不在IE8工作
- 映射/设置与ie8工作的实现
- window.attachEvent没有'我似乎在IE8工作
- Fancybox Overlay Helper'我不在IE8工作