Last active
August 29, 2015 14:21
-
-
Save shaunjanssens/2d0fbbb95aae67794cd1 to your computer and use it in GitHub Desktop.
Grid met css3's calc()
This file contains hidden or 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
.container { | |
max-width: 1140px; | |
margin-left: auto; | |
margin-right: auto; | |
} | |
.row:before, | |
.row:after { | |
content: " "; | |
display: table; | |
} | |
.row:after { | |
clear: both; | |
} | |
.col { | |
float: left; | |
box-sizing: border-box; | |
} | |
.col-1 { | |
width: calc(1/12 * 100%); | |
} | |
.col-2 { | |
width: calc(2/12 * 100%); | |
} | |
.col-3 { | |
width: calc(3/12 * 100%); | |
} | |
.col-4 { | |
width: calc(4/12 * 100%); | |
} | |
.col-5 { | |
width: calc(5/12 * 100%); | |
} | |
.col-6 { | |
width: calc(6/12 * 100%); | |
} | |
.col-7 { | |
width: calc(7/12 * 100%); | |
} | |
.col-8 { | |
width: calc(8/12 * 100%); | |
} | |
.col-9 { | |
width: calc(9/12 * 100%); | |
} | |
.col-10 { | |
width: calc(10/12 * 100%); | |
} | |
.col-11 { | |
width: calc(11/12 * 100%); | |
} | |
.col-12 { | |
width: 100%; | |
} |
This file contains hidden or 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
<div class="container"> | |
<div class="row"> | |
<div class="col col-6"> | |
</div> | |
<div class="col col-6"> | |
</div> | |
</div> | |
<div class="row"> | |
<div class="col col-4"> | |
</div> | |
<div class="col col-4"> | |
</div> | |
<div class="col col-4"> | |
</div> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment