I'm trying to vertically stack 3 DIVs, where each DIV takes around one third (33.33%) of the vertical area, so eventually, all three of them will fill the entire screen. But at the same time, I want a margin of 8px around all three of them without having a scroll-bar. Like in the following image...
So in the end, I have a responsive layout, separated vertically into 3 sections, with a margin around all of them (With no scroll-bar appearing)
This is my current code:
body {
margin: 8px;
background: red;
}
.header {
width: 100%;
height: 33.33%;
background: #fff;
}
.content {
width: 100%;
height: 33.33%;
background: #ccc;
}
.footer {
width: 100%;
height: 33.33%;
background: #777;
}
<div class="container">
<div class="header">
header
</div>
<div class="content">
content
</div>
<div class="footer">
footer
</div>
</div>
For some reason, this code works fine in (https://liveweave.com/), but it doesn't work in the chrome browser