Skip to content

Instantly share code, notes, and snippets.

@bellerus
Created July 16, 2013 22:26
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 bellerus/6015756 to your computer and use it in GitHub Desktop.
Save bellerus/6015756 to your computer and use it in GitHub Desktop.
Selectors
/* Selectors */
body {
background: #00a3e6;
color: white;
font-size: 40px;
font-family: Helvetica;
min-height: 100%;
}
/* descendant */
.container ol {
}
/* child */
.container > ol {
margin-left: 50px;
}
/* sibling */
span + span {
}
/* pseudo */
ol li:first-child, ol li:last-child {
}
/* pseudo */
ol li:nth-of-type(odd) {
}
/* pseudo */
li:hover {
}
input[type="text"][class~="valid"] {
background: red;
}
<div class="container">
<ol>
<li>:link</li>
<li>:visited</li>
<li>:active</li>
<li>:hover</li>
<li>:nth-of-type</li>
<li>:even/odd</li>
<li>:enabled</li>
<li>:checked</li>
<li>:disabled</li>
<li>
<ol>
<li>secondary</li>
</ol>
</li>
</ol>
</div>
<span>part 1</span><span>part 2</span>
<input type="text" class="login valid" value="Hi there" />
<input type="submit" class="login valid" checked />
// alert('Hello world!');
{"view":"separate","fontsize":"200","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment