【发布时间】:2018-05-13 14:21:45
【问题描述】:
我有一个简单的布局,如果文本不在footer 元素中,我希望它是红色的。它适用于p 标签、a 标签等。
但是当我尝试使用footer 标签时它不起作用。
我的代码如下:
p {
color: #000000;
}
:not(footer) {
color: #ff0000;
}
<h1>This is a heading</h1>
<footer>This is a footer.</footer>
<div>This is some text in a div element.</div>
<a href="https://www.w3schools.com" target="_blank">Link to W3Schools!</a>
【问题讨论】:
标签: html css css-selectors