Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Descendant and Child CSS Selectors

<html>
<head>
<title>The title</title>
<link rel="stylesheet" href="selectors.css" />
</head>
<body>
<h1>Main title</h1>

<ul>
  <li><a href="http://pm.org/">Perl Monger</a></li>
  <li><p><a href="http://perlmaven.com/">Perl Maven</a></p></li>
</ul>
<p><a href="http://perlmonks.com/">Perl Monks</a></p>

</body>
</html>
/*
a {
  background-color: red;
}


li a {
  background-color: yellow;
}
*/

/*
p  a {
  background-color: green;
}
*/


/*

li > a {
  background-color: green;
}

*/

[List of selectors](http://www.w3.org/TR/CSS2/selector.html“ %}