div.entry-content:not(body.single div.entry-content)
{
font-family: 'Droid Sans', sans-serif;
margin-top:10px;
line-height: 114%;
font-size:15px;
}
上面的css根本不影响任何元素....我希望与类一起div.entry-content
存在于a内的元素的样式与其余元素的样式不同..body
single
div.entry-content
body.single div.entry-content
{}
和
div.entry-content
{}
确实看起来还不错..但是
div.entry-content:not(body.single div.entry-content)
{}
似乎没有
您需要重写选择器行才能按照预期的方式工作:
body:not(.single) div.entry-content {
font-family: 'Droid Sans', sans-serif;
margin-top:10px;
line-height: 114%;
font-size:15px;
}
这个CSS Tricks页面详细说明了您只能在:not
伪类中使用简单的选择器这一事实,它们在脚注中的定义如下:
简单选择器分为类型选择器,通用选择器,属性选择器,类选择器,ID选择器或伪类选择器。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句