Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Quantity Queries
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>page title</title>
<style>
.container {
margin: 40px;
}
.thing {
outline: 2px solid green;
padding: 20px;
margin: 10px;
}
.thing:nth-last-child(8):first-child,
.thing:nth-last-child(8):first-child ~ .thing {
outline: 1px solid blue;
}
.thing:nth-last-child(3):first-child,
.thing:nth-last-child(3):first-child ~ .thing {
outline: 1px solid red;
}
</style>
</head>
<body>
<h1>Quantity Selectors</h1>
<ul>
<li><a href="http://alistapart.com/article/quantity-queries-for-css" title="Quantity Queries for CSS · An A List Apart Article">http://alistapart.com/article/quantity-queries-for-css</a></li>
<li><a href="http://www.aaron-gustafson.com/notebook/quantity-queries-where-have-you-been-all-my-life/" title="Quantity Queries… Where Have You Been All My Life?, From the Notebook of Aaron Gustafson">http://www.aaron-gustafson.com/notebook/quantity-queries-where-have-you-been-all-my-life/</a></li>
<li><a href="https://github.com/danielguillan/quantity-queries">https://github.com/danielguillan/quantity-queries</a></li>
<li><a href="http://codepen.io/danielguillan/pen/GgBOxm" title="Quanity Queries Sass mixins demo">http://codepen.io/danielguillan/pen/GgBOxm</a></li>
</ul>
<div class="container">
<div class="thing">thing</div>
</div>
<div class="container">
<div class="thing">thing</div>
<div class="thing">thing</div>
</div>
<div class="container">
<div class="thing">thing</div>
<div class="thing">thing</div>
<div class="thing">thing</div>
<div class="thing">thing</div>
<div class="thing">thing</div>
<div class="thing">thing</div>
<div class="thing">thing</div>
<div class="thing">thing</div>
</div>
<div class="container">
<div class="thing">thing</div>
<div class="thing">thing</div>
<div class="thing">thing</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.