I am facing a situation where I need to ensure that when scrolling down, a fixed pink menu bar at the bottom of the page does not overlap with the main blue content. This can be achieved by treating the blue content as an iframe positioned 60px from the bottom of the page, all through CSS without using an actual iframe element.
.main-content {
background-color:blue;
width:100%;
height:3000px;
}
.fixed-menu {
height:50px;
background-color:pink;
position:fixed;
bottom:20px;
width:100%;
padding:20px;
}
<div class="container">
<div class="main-content">
</div>
<div class="fixed-menu">
Fixed menu at the bottom. The main content should stop above this bar, so the bar never overlaps the content when scrolling.
</div>
</div>
Has anyone ever encountered a similar requirement? Is it possible to achieve this effect solely through CSS? Check out this example on https://jsfiddle.net/0e98os22/2/r