Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<head>
<title>Descendant combinator</title>
<style type="text/css"><![CDATA[.white { background-color: transparent ! important; }
.red { background-color: red; }
div.t1 p { background-color: lime; }]]></style>
<link rel="author" title="Daniel Glazman" href="http://glazman.org/"/>
<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 -->
</head>
<body>
<div class="t1">
<p class="red">This paragraph should have a green background</p>
<table>
<tbody>
<tr>
<td>
<p class="red">This paragraph should have a green background</p>
</td>
</tr>
</tbody>
</table>
</div>
<table>
<tbody>
<tr>
<td>
<p class="white">This paragraph should be unstyled.</p>
</td>
</tr>
</tbody>
</table>
</body>
</html>