Created
May 9, 2013 10:01
-
-
Save FrankM1/5546659 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
#navigation .main_menu > ul > li{ | |
/* one item */ | |
&:first-child:nth-last-child(1) { | |
width: 100%; | |
} | |
/* two items */ | |
&:first-child:nth-last-child(2), | |
&:first-child:nth-last-child(2) ~ li { | |
width: 50%; | |
} | |
/* three items */ | |
&:first-child:nth-last-child(3), | |
&:first-child:nth-last-child(3) ~ li { | |
width: 33.3333%; | |
} | |
/* four items */ | |
&:first-child:nth-last-child(4), | |
&:first-child:nth-last-child(4) ~ li { | |
width: 25.0%; | |
} | |
/* five items */ | |
&:first-child:nth-last-child(5), | |
&:first-child:nth-last-child(5) ~ li { | |
width: 20.0%; | |
} | |
/* six items */ | |
&:first-child:nth-last-child(6), | |
&:first-child:nth-last-child(6) ~ li { | |
width: 16.0%; | |
} | |
/* seven items */ | |
&:first-child:nth-last-child(7), | |
&:first-child:nth-last-child(7) ~ li { | |
width: 14.0%; | |
} | |
/* eight items */ | |
&:first-child:nth-last-child(8), | |
&:first-child:nth-last-child(8) ~ li { | |
width: 11.0%; | |
} | |
/* nine items */ | |
&:first-child:nth-last-child(9), | |
&:first-child:nth-last-child(9) ~ li { | |
width: 11.11111%; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment