I need to make the pink div 100% browser height, height: 100vh
doesn’t work right, there’s a scrollbar so it’s like 105%…
html,
body {
width: 100%;
height: 100%;
color: white;
background-color: #002B5A;
margin: 0;
padding: 0;
direction: rtl;
}
#right {} #left {
min-height: 100%;
height: 100%;
background-color: #CA1F4B;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" id="right">
right
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12 col-lg-offset-1 col-md-offset-1 col-sm-offset-1 col-lg-offset-1" id="left">
left
</div>
</div>
2
Answers
You need to set
#right
‘s height to100%
.Because
#left
is a child of the#right
element, it is only being100%
of the parent’s height. As#right
is only set toheight:auto;
by default, it wont be100%
.(Look at snippet in full screen)
Bootply
Try removing the min-height and changing the height to vmax, vmin or vh.
http://www.bootply.com/dGavhuGt6g#