作者:mobiledu2502862117 | 来源:互联网 | 2022-12-31 18:54
我想套用green
background
到段落与类和red
一个所有其他人.我已经完成了一半,但仍在努力解决空课 class=""
:
p {background:green}
#test p:not([class]) {
background: red;
color: #fff;
}
This should be red
This should be green
This should be green
This should be red
This should be green
This should be red
This should be red
小提琴
有人知道吗?
1> sol..:
您可以p
使用像这样的空类来定位...
p[class=""] {
...
}
body {
font-weight: 700;
}
p {
background: green
}
#test p:not([class]),
#test p[class=""] {
background: red;
color: #fff;
}
This should be red
This should be green
This should be green
This should be red
This should be green
This should be red
This should be red