我想编写一个CSS选择器规则,选择所有没有特定类的元素.例如,给定以下HTML:
<html class="printable">
<body class="printable">
<h1 class="printable">Example</h1>
<nav>
<!-- Some menu links... -->
</nav>
<a href="javascript:void(0)" onclick="javascript:self.print()">Print me!</a>
<p class="printable">
This page is super interresting and you should print it!
</p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我想编写一个选择器来选择所有没有"可打印"类的元素,在这种情况下,它是nav和元素.
这可能吗?
注意:在我想要使用它的实际HTML中,将会有更多的元素没有 "可打印"类而不是(我在上面的例子中意识到它是另一种方式).