Skip to content

Instantly share code, notes, and snippets.

@alexmcpherson
Last active August 29, 2015 13:56
Show Gist options
  • Save alexmcpherson/9199560 to your computer and use it in GitHub Desktop.
Save alexmcpherson/9199560 to your computer and use it in GitHub Desktop.
More advanced selectors
<html>
<head></head>
<body>
<div>
<span>Bold!</span>
<span>Not bold...</span>
</div>
<ul>
<li class='first'>Apples</li>
<li>Oranges</li>
<li>Pears</li>
</ul>
<div>
<h2>Menu:</h2>
<div>
<ul>
<li>
Sandwiches
<ul>
<li>Monte Cristo</li>
</ul>
</li>
</ul>
</div>
</div>
</body>
</html>
a:hover {
cursor: pointer;
}
span:first-child {
font-weight: bold;
}
ul li.first + li {
color: ##FFA500; /* Orange! */
}
div > ul {
border: 1px solid #333333; /* Only outside list bordered */
}
* {
display: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment