Created
June 24, 2014 07:52
-
-
Save blake-simpson/88f943901b395c19d749 to your computer and use it in GitHub Desktop.
CSS fluid (unknown N) children (LESS)
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
.fluid { | |
&:after { | |
content: ""; | |
clear: both; | |
display: block; | |
} | |
.item { | |
float: left; | |
} | |
.item:first-child:nth-last-child(1) { | |
width: 100%; | |
} | |
.item:first-child:nth-last-child(2), | |
.item:first-child:nth-last-child(2) ~ .item { | |
width: 50%; | |
} | |
.item:first-child:nth-last-child(3), | |
.item:first-child:nth-last-child(3) ~ .item { | |
width: 33.3333%; | |
} | |
.item:first-child:nth-last-child(4), | |
.item:first-child:nth-last-child(4) ~ .item { | |
width: 25%; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment