H1 turning blue outside of class scope

Am I going insane? Why is this happening? I only want the p and h1 in the "one" class to turn blue. Codepen: https://codepen.io/SirFloki/pen/VwGjYJp
Daniel
CodePen
VwGjYJp
...
3 Replies
Jochem
Jochem2y ago
you need this:
.one h1, .one p{
color: blue;
}
.one h1, .one p{
color: blue;
}
The comma completely resets the selector Alternatively:
.one :is(h1, p) {
color: blue;
}
/*or*/
.one :where(h1, p) {
color: blue;
}
.one :is(h1, p) {
color: blue;
}
/*or*/
.one :where(h1, p) {
color: blue;
}
sirfloki.
sirfloki.OP2y ago
I see...so the second selector after the comma is selecting all paragraphs and isn't scoped to the "one" class. It's very odd this is the first time I've run into this issue. But now I know. Thanks!
Jochem
Jochem2y ago
That's correct. And you're welcome glad to help!
Want results from more Discord servers?
Add your server