Pseudoclasses :first-child and :last-child for IE6

来源:互联网 发布:中级程序员考证培训费 编辑:程序博客网 时间:2024/06/06 07:14

#subnav li {background-color: green;}
#subnav li:first-child {background-color: red;}

CSS for IE 6 (using conditional comments):

<!–-[if IE 6]>
#subnav li {background-color: expression_r(this.previousSibling==null?'red':'green');}
<![endif]-->

Similar to :last-child
Instead of this.previousSibling==null there should be this.nextSibling==null


原创粉丝点击