Skip to content

Instantly share code, notes, and snippets.

@techxdeveloper
Created October 1, 2017 11:27
Show Gist options
  • Save techxdeveloper/550a24e186268134a46aac6da3c651fd to your computer and use it in GitHub Desktop.
Save techxdeveloper/550a24e186268134a46aac6da3c651fd to your computer and use it in GitHub Desktop.
CSS Descendant Selector
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS Descendant Selector</title>
<style>
h1 {
color: #00bdc4;
border-bottom: 1px solid #bdbdbd;
padding-bottom: 20px;
}
.list1 li {
background-color: #9c27b0;
}
.list2 a {
color: #00bdc4;
}
.list3 a {
color: #fafafa;
}
.list3 p {
background-color: #673ab7;
}
</style>
</head>
<body>
<div>
<h1>CSS Descendant Selector</h1>
<ul class="list1">
<li>Something</li>
<li>Something</li>
<li>Something</li>
<li>Something</li>
</ul>
<ul class="list2">
<li><a href="#!">Something</a></li>
<li><a href="#!">Something</a></li>
<li><a href="#!">Something</a></li>
</ul>
<ul class="list3">
<li><a href="#!"><p>Something</p></a></li>
<li><a href="#!"><p>Something</p></a></li>
<li><a href="#!"><p>Something</p></a></li>
</ul>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment