Reputation: 4047
In my html page there are two type of <p>
-
<p class="header"> for some Paragraph in header</p>
<p>Containing some text </p>
I want a color
for the only p
(should be some #xxxxx
) and for p.header
it should be the default color.
Here is my css:
p {
margin-bottom:18px;
line-height:180%;
color:#xxxxx;
}
What I want is, this css should not get applied to p.header
and it should use default style of browsers. Is there any way to select only p
that are not in p.header
?
like
p:not("p.header"){
margin-bottom:18px;
line-height:180%;
color:#xxxxx;
}
Can we also use that like, p:not(.header, .sub-title){}
?
Upvotes: 0
Views: 118
Reputation: 1069
p:not(.header) {
margin-bottom:18px;
line-height:180%;
color:red;
}
Just removed the quotation marks and the p
Fiddle here
Upvotes: 2