Skip to content

Instantly share code, notes, and snippets.

@SirPepe
Created May 31, 2013 20:03
Show Gist options
  • Save SirPepe/5687601 to your computer and use it in GitHub Desktop.
Save SirPepe/5687601 to your computer and use it in GitHub Desktop.
Demo CSS-Pseudoklassen-Typen
/**
* Demo CSS-Pseudoklassen-Typen
*/
/* :nth-child OHNE Element */
/*#foo :nth-child(2n+1){ color: red; }*/
/* :nth-child MIT Element */
/*#foo span:nth-child(2n+1){ color: red; }*/
/* :nth-of-type */
/*#foo span:nth-of-type(2n+1){ color: red; }*/
<div id="foo">
<span>Span</span>
<span>Span</span>
<div>Div</div>
<span>Span</span>
<div>Div</div>
<div>Div</div>
<span>Span</span>
<div>Div</div>
<span>Span</span>
<div>Div</div>
<span>Span</span>
<div>Div</div>
</div>
<style>
body {
padding-top: 3em;
}
#foo {
font-size: 1.2em;
line-height: 1.75;
}
#foo > * {
display: block;
}
</style>
// alert('Hello world!');
{"view":"split-vertical","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