在我的html页面中有两种<p>
-
<p class="header"> for some Paragraph in header</p>
<p>Containing some text </p>
我希望color
仅用于p
(应该是某些#xxxxx
),而对于p.header
,它应该是默认颜色。
这是我的css:
p {
margin-bottom:18px;
line-height:180%;
color:#xxxxx;
}
我想要的是,这个css不应该应用于p.header
,它应该使用默认的浏览器样式。有没有办法只选择p
以外的p.header
?
喜欢
p:not("p.header"){
margin-bottom:18px;
line-height:180%;
color:#xxxxx;
}
我们也可以使用p:not(.header, .sub-title){}
吗?
答案 0 :(得分:2)
答案 1 :(得分:1)
p:not(.header) {
your properties
}
那应该有用......