Skip to content

Instantly share code, notes, and snippets.

@stijnj
Created December 19, 2012 20:57
Show Gist options
  • Save stijnj/4340345 to your computer and use it in GitHub Desktop.
Save stijnj/4340345 to your computer and use it in GitHub Desktop.
Box-model: content-box vs. border-box
/**
* Box-model: content-box vs. border-box
*/
div {
width: 300px;
border: 1px solid black;
}
span {
box-sizing: border-box;
display: inline-block;
float: left;
width: 33%;
text-align: center;
padding: 10px;
}
div::after { content: ''; display: block; clear: both; }
<div class="foo">
<span>first</span>
<span>second</span>
<span>third</span>
</div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment