E:last-child{ sRules }
有效的代码:
p:last-child{color:#f00;}
我是一个标题
我是一个p
无效的代码:
p:last-child{color:#f00;}
我是一个p
我是一个标题
在上述代码中,如果我们要设置第一个li的样式,那么代码应该写成li:first-child{sRules},而不是ul:first-child{sRules}。
| IE | Firefox | Safari | Chrome | Opera |
|---|---|---|---|---|
| 6.0-8.0 | 4.0 | 4.0 | 14.0 | 15.0 |
| 9.0 |