在我的 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){}
?
最佳答案
关于html - 仅将 css 分配给 p 而不是特定的 p.class,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26032615/