<div id="content-box">
<p>
<h3>box-sizing: content-box;</h3>
<h4> Цей контейнер має розмір 400px. Ширину + 40px. padding + 20px = 480px.</h4>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.</p>
</div>
<div id="border-box">
<p>
<h3>box-sizing: border-box;</h3>
<h4>Цей контейнер має розмір 400px.</h4> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.</p>
</div>
div {
transition:;
}
#content-box{
width:400px;
background:#ccc;
padding:20px;
border:10px solid black;
box-sizing: content-box;
box-sizing: content-box;
box-sizing: content-box;
float:left;
margin-right: 20px;
}
#border-box {
width:400px;
background:#ccc;
padding:20px;
border:10px solid black;
box-sizing: border-box;
box-sizing: border-box;
box-sizing: border-box;
float:left;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.