【发布时间】:2013-04-16 15:08:49
【问题描述】:
我的 HTML 是这样的:
<!DOCTYPE html>
<html lang="en">
<link rel="stylesheet" href="stylesheet.css">
<head>
</head>
<body>
<p>hiya</p>
<h1>this is h1</h1>
<h2>this is h2</h2>
</body>
</html>
我的 stylsheet.css 是这样的:
:not(p)
{
color:#ff0000;
}
然而一切都是红色的,包括<p>。我尝试过 Firefox 20、Internet Explorer 10 和 Chrome。它似乎没有比这更基本的了,但我不知道为什么这不起作用(即防止<p> 变红)。对此的任何帮助将不胜感激。
【问题讨论】:
-
我认为,在 css 中,你在 stylesheet.css 中使用 body { color: red }
标签: html css css-selectors