Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<head>
<title>Combinations: classes and IDs</title>
<style type="text/css"><![CDATA[
p { background: red; color: yellow; }
p:not(#other).class:not(.fail).test#id#id { background: green; color: white; }
div { background: green; color: white; }
div:not(#theid).class:not(.fail).test#theid#theid { background: red; color: yellow; }
div:not(#other).notclass:not(.fail).test#theid#theid { background: red; color: yellow; }
div:not(#other).class:not(.test).test#theid#theid { background: red; color: yellow; }
div:not(#other).class:not(.fail).nottest#theid#theid { background: red; color: yellow; }
div:not(#other).class:not(.fail).nottest#theid#other { background: red; color: yellow; }
]]></style>
<link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/>
<link rel="help" href="https://www.w3.org/TR/css3-selectors/#selectors"/> <!-- bogus link to make sure it gets found -->
<link rel="match" href="reference/this-line-green-background.xht"/>
</head>
<body>
<p id="id" class="class test">This line should be green.</p>
<div id="theid" class="class test">This line should be green.</div>
</body>
</html>