:not 伪类选择器可以筛选不符合表达式的元素
例子
table tbody tr:not(:first-child):not(:last-child) td
{
text-align: right;
}
|
|
|
/*选中非段落元素*/
:not(p)
{
}
|
|
|
/*选中div里面非首个、非最后一个的中间p元素*/
div p:not(:first-child):not(:last-child){
}
|
|
|