I have been working with the bootstrap4 layout, and I noticed that when the screen width is less than 992px, the yellow-div is overlapping the brown-div. Can someone explain why this is happening and suggest a solution?
Below is the code snippet:
.header {
height: 100px;
}
.header .blue {
height: 100%;
background-color: blue;
}
.header .brown {
height: 100%;
background-color: brown;
}
.content {
height: 100px;
}
.content .yellow {
height: 100%;
background-color: yellow;
}
.content .green {
height: 100%;
background-color: green;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="row header ">
<div class="col-md-2 col-xl-2 blue ">blue div</div>
<div class="col-md-10 col-xl-10 brown">brown div</div>
</div>
<div class="row content ">
<div class="col-md-2 col-xl-2 yellow ">yellow div</div>
<div class="col-md-10 col-xl-10 green">green div</div>
</div>
</div>