Last active
July 25, 2018 09:45
-
-
Save artemsheludko/c6d713b44f72d4f8185e28fd9563a62d to your computer and use it in GitHub Desktop.
This file contains 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
<ul> | |
<li><a href="">First item</a></li> | |
<li>Second item</li> | |
<li><a href="">Test</a></li> | |
<li><a href="">Test</a></li> | |
<li><a href="">Pre-last item</a></li> | |
<li><a href="">Last item</a></li> | |
</ul> | |
// To choose the last two LI elements you do (выбрать последнии два эмеленты из списка): | |
ul > li:nth-last-of-type(-n+2) { | |
background: green; | |
} | |
// To choose the first two LI elements you do (выбрать первые два эмеленты из списка): | |
ul > li:nth-child(-n+2) { | |
background: red; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment