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

Basic Selectors

  • HTML tag
  • HTML attributes: id, class
<html>
<head>
<title>The title</title>
<link rel="stylesheet" href="basic-selectors.css" />
</head>
<body>
<h1>Main title</h1>
<p>
First paragraph of text.
</p>
<p class="abc">
Second paragraph of text.
</p>
<p id="part3">
Third paragraph of text.
</p>
<a class="abc" href="http://perlmaven.com/">Perl Maven</a>

</body>
</html>
/*

p {
  background-color: red;
}

.abc {
  background-color: blue;
}

#part3 {
  background-color: green;
}

*/