I am trying to make the flexbox-container
work on percentage height but it is not working. However, it behaves correctly on pixel height.
My body is divided into upper and lower. Upper should consist of 70% height and lower should have 30%. Upper is working correctly but lower is not. Background color does not automatically takes 30% height.
html,
body {
margin: 0;
padding: 0;
height: 100%;
background-image: url("../photo.jpg");
background-repeat: no-repeat;
background-size: cover;
background-position-y: -300px;
background-attachment: fixed;
}
#upper-body {
height: 70%;
}
#body-left {
display: flex;
flex-direction: column;
justify-content: space-between;
height: 100%;
}
#fullheight {
height: 100%;
}
#lower-body {
height: 30%;
}
#lower-first-block {
height: 30%;
}
<section id="upper-body">
<div class="dark-overlay">
<div class="container-fluid" id="fullheight">
<div class="row" id="fullheight">
<div class="col-md-3" id="fullheight">
<div id="body-left">
<div id="header-text">
<h1>Web<span id="head-text-color">|App</span></h1>
</div>
<div id="button">
<!--This appears at down-->
<h1>Button</h1>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="lower-body">
<div class="row" id="full-height">
<div class="col-md-6 blue-background" id="full-height">
<div id="lower-first-block">
</div>
</div>
<div class="col-md-2 blue-background" id="full-height">
</div>
<div class="col-md-2 blue-background" id="full-height">
</div>
<div class="col-md-2 blue-background" id="full-height">
</div>
</div>
</section>
Here's my desired layout: