Skip to content

Instantly share code, notes, and snippets.

@AllThingsSmitty
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AllThingsSmitty/9327055 to your computer and use it in GitHub Desktop.
Save AllThingsSmitty/9327055 to your computer and use it in GitHub Desktop.
Creating a grid using box-sizing in CSS3
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Box-Sizing Grid</title>
<style>
.row:after {
clear: both;
content: "";
display: block;
}
.column {
box-sizing: border-box;
float: left;
min-height: 8em;
overflow: hidden;
padding: 2em;
width: 25%;
}
.column:nth-child(1) { background: #9df5ba; }
.column:nth-child(2) { background: #9df5d7; }
.column:nth-child(3) { background: #9df5f5; }
.column:nth-child(4) { background: #9dd7f5; }
</style>
</head>
<body>
<div class="row">
<div class="column">Col one</div>
<div class="column">Col two</div>
<div class="column">Col three</div>
<div class="column">Col four</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment