Skip to content

Instantly share code, notes, and snippets.

@lessallan
Created June 21, 2010 03:34
Show Gist options
  • Save lessallan/446358 to your computer and use it in GitHub Desktop.
Save lessallan/446358 to your computer and use it in GitHub Desktop.
=lesscolumns($width_of_page :960px, $number_of_columns :4, $column_padding :10px, $width_of_gutter :10px, $border_width :0px, $border_style :solid, $border_color :#333)
$number_of_gutters: $number_of_columns - 1
$width_of_column: ($width_of_page - ($width_of_gutter * $number_of_gutters)) / $number_of_columns - ($column_padding * 2) - ($border_width * 2)
width: $width_of_page
+pie-clearfix
> *
width: $width_of_column
margin-left: $width_of_gutter
padding: $column_padding
border: $border_width $border_style $border_color
float: left
&:first-child
margin-left: 0px
#test
+lesscolumns(962px, 4, 10px, 10px, 1px, dotted, #333)
@lessallan
Copy link
Author

IE8 doesn't

@guenin
Copy link

guenin commented Jun 30, 2010

Sure it does. IE has better :first-child support than :last-child, for whatever reason.

http://www.quirksmode.org/css/contents.html#t17

@lessallan
Copy link
Author

John wins!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment