<div class="container">
<div class="content">
By setting <code>box-sizing</code> to <code>border-box</code>, the <code>width</code> of this box will always be 200 pixels on any browser.
</div>
</div>
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
.container {
& {
width: 200px;
padding: 20px;
background: #eee;
border: 1px solid black;
}
> .content {
background: #ddd;
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.