Skip to content

Instantly share code, notes, and snippets.

@krambuhl
Last active August 29, 2015 13:56
Show Gist options
  • Save krambuhl/8855883 to your computer and use it in GitHub Desktop.
Save krambuhl/8855883 to your computer and use it in GitHub Desktop.
A general layout module for creating columns.
.slice {
display: table;
table-layout: fixed; // makes items equal sizes automatically
width: 100%;
}
.slice-auto {
table-layout: auto; // items will resize based on content size
}
.slice-item {
display: table-cell;
vertical-align: top;
width: 100%;
}
// returning tables/cells to divs will stack items
@media only screen and (max-width: 640px) {
.slice,
.slice-item {
display: block !important;
width: 100% !important;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment