Skip to content

Instantly share code, notes, and snippets.

@maxhoffmann
Created March 20, 2012 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxhoffmann/2133532 to your computer and use it in GitHub Desktop.
Save maxhoffmann/2133532 to your computer and use it in GitHub Desktop.
CSS3 selectors
/* CSS3 selectors */
ul { font-size: 1.5em; color: #999; }
li:last-child { color: red; }
li:nth-child(3n) { color: RoyalBlue; }
li[class^=test] { color: orange } /* starts with */
/* li[class$=test] ends with */
/* li[class*=es] enthält */
<ul>
<li>eins
<li>zwei
<li>drei
<li class="testtest">vier
<li>fünf
<li>sechs
<li>sieben
<li class="testklasse">acht
<li>neun
<li>zehn
</ul>
{"view":"separate","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment