【发布时间】:2016-05-25 19:56:10
【问题描述】:
我想我发现了 :not 选择器的错误,但我不确定在 CSS 中的哪里提交错误?
text-decoration 将应用于 :not 中的元素
查看我整理的这个小代码笔,颜色应用正确但下划线不正确。
https://codepen.io/miketricking/pen/YWKGyJ
p {
color: #000000;
}
:not(p) {
color: red;
text-decoration: underline;
}
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<div>This is some text in a div element.</div>
【问题讨论】:
-
正如@BoltClock所说,样式继承自
html和body元素,可以在浏览器开发者工具中看到-see here
标签: html css css-selectors