Skip to content

Instantly share code, notes, and snippets.

@tdhsmith
Last active August 29, 2015 14:27
Show Gist options
  • Save tdhsmith/f04510a8aaa722220b88 to your computer and use it in GitHub Desktop.
Save tdhsmith/f04510a8aaa722220b88 to your computer and use it in GitHub Desktop.
Nth-of-type and compound selectors demo
/**
* Nth-of-type and compound selectors demo
*/
p.third:nth-of-type(3) {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
}
p .not-last:nth-of-type(1) {
font-weight: bold;
}
<!-- content to be placed inside <body>…</body> -->
<p class="first not-last">I'm the first.</p>
<p class="second not-last">I'm the second.</p>
<p class="third">I'm the third.</p>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment