<div class="container">
<div class="block">Content Box</div>
<div class="block">Content Box</div>
<div class="block">Content Box</div>
</div>
/*
Calc Demo 100% Container, equally distribute containers within the box.
--
In this demo, we make the width of each box 100% divided by the number of boxes then subtract the margin left & right.
As you scale the page the box will always be 1/3 of the total width.
*/
.container {
width:80%;
height:200px;
margin:auto;
}
.block {
width: calc(100% / 3 - 10px);
height:100%;
margin-left:5px;
margin-left:5px;
padding:10px;
border: 10px dashed white;
}
/*
boring stuff
*/
html {
box-sizing: border-box;
}
:root {
background-color: #373150;
font-size: 16px;
font-weight: 400;
text-rendering: geometricPrecision;
line-height: 1.4;
text-decoration-skip: ink;
font-family: -apple-system-headline, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
*, *:before, *:after {
box-sizing: inherit;
}
body {
margin:0;
padding:0;
}
.block {
float:left;
display:inline-block;
background-color:#EF6174;
color:white;
font-size: 0.9rem;
text-align: center;
line-height:4em;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.