首页 > 其他 > 详细

IE6/IE7不支持first-child的解决办法

时间:2017-12-28 17:47:20      阅读:245      评论:0      收藏:0      [点我收藏+]
#sidebar li:first-child{
border-top-style:none;
}
#sidebar li{
border-top-width:1px;
border-top-style:solid;
border-color:#DAD3D0;
*border-top-style:expression(this.previousSibling==null?"none":"solid");
}

代码解析

*border-top-style:expression(this.previousSibling==null?’none’:"solid’);

只有IE6和IE7能识别此行代码,第一个值’none’就是first-child的值,第二个值’solid’则是其他元素的值。

last-child原理相同,代码如下

#sidebar li:last-child{
border-bottom-style:none;
}
#sidebar li{
border-bottom-width:1px;
border-bottom-style:solid;
border-color:#DAD3D0;
*border-bottom-style:expression(this.nextSibling==null?"none":"solid");
}

原文参考链接:http://www.sjyhome.com/css/ie6-ie7-first-child.html

IE6/IE7不支持first-child的解决办法

原文:https://www.cnblogs.com/jkingdom/p/8136781.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!