Created
May 21, 2012 18:56
-
-
Save tyv/2763959 to your computer and use it in GitHub Desktop.
E:nth-child(an+b)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
E:nth-child(an+b) | |
разбивает все E-элементы | |
на a-групп (остаток в последней) | |
выделает b-элемент в каждой | |
E:nth-last-child(an+b) | |
тоже самое но с конца коллекции элементов | |
могут принимать значения odd (=2n+1) | |
и even (2n) | |
*/ | |
.parent li:nth-child(3n+1) | |
{ | |
border: 1px solid red; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ol class="parent"> | |
<li class="child child01">child</li> | |
<li class="child child02"> | |
child | |
<div class="descendant">descendant</div> | |
<div class="child">fake child</div> | |
<ul> | |
<li>sublist</li> | |
<li>sublist</li> | |
</ul> | |
</li> | |
<li class="child child03">child</li> | |
<li class="child child04">child</li> | |
<li class="child child05">child</li> | |
<li class="child child06">child</li> | |
<li class="child child07">child</li> | |
<li class="child child08">child</li> | |
<li class="child child09">child</li> | |
<li class="child child10">child</li> | |
<li class="child child11">child</li> | |
</ol> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"view":"separate","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