Created
May 4, 2012 23:26
-
-
Save jonathansousa/2598343 to your computer and use it in GitHub Desktop.
CSS: Hide n in List but not Last
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
&.last { | |
display:none; | |
} | |
&:nth-child(n+6) { /* Set the number to the number of menu items to show including "more" */ | |
display:none; | |
&:nth-last-child(-n+1) { | |
display:block; | |
} | |
} | |
&.last:nth-child(6) { /* Make sure this number matches the menu items above to hide the more item at the right time */ | |
display:none; | |
} |
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
&.last { | |
display:none; | |
} | |
&:nth-child(n+6) { /* Set the number to the number of menu items to show including "more" */ | |
display:none; | |
&:nth-last-child(-n+1) { | |
display:block; | |
} | |
} | |
&.last:nth-child(6) { /* Make sure this number matches the menu items above to hide the more item at the right time */ | |
display:none; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment