Created
May 21, 2012 16:54
-
-
Save tyv/2763259 to your computer and use it in GitHub Desktop.
E:nth-of-type(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-of-type(an+b) | |
тоже самое, но работает только с группой E-элементов | |
p:nth-child(2) | |
это параграф && это второй элемент своего родителя | |
p:nth-of-type(2) | |
это второй параграф своего родителя | |
http://css-tricks.com/the-difference-between-nth-child-and-nth-of-type/ | |
*/ | |
.parent p:nth-child(2) | |
{ | |
color: red; | |
} | |
.parent p:nth-of-type(2) | |
{ | |
text-decoration: line-through; | |
} |
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
<div class="parent"> | |
<p>параграф 1</p> | |
<p>параграф 2</p> | |
</div> | |
<hr> | |
<div class="parent"> | |
<h3>заголовок</h3> | |
<h4>подзаголовок</h4> | |
<p>параграф 1</p> | |
<p>параграф 2</p> | |
</div> | |
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