How is it possible to accomplish this css problem below?
This is when a screen has enough space to keep elements viewable.
But once the window gets shrunk and doesn't have enough space to keep them viewable in the original size, top and bottom elements stick to the vertical side in the original size, and only the middle element gets shrunk.
I'm stuck in this status. It looks almost close to the answer at glance but it's actually not...
http://embed.plnkr.co/AJXYCGEVzMPt1My0xehA/
Stack snippet
/* Styles go here */
.wrapper {
height: 100vh;
}
.top {
width: 40%;
height: 50px;
background-color: green;
}
.middle {
width: 90%;
height: 300px;
background-color: blue;
margin-top: 30px;
margin-bottom: 30px;
}
.bottom {
width: 20%;
height: 50px;
background-color: red;
}
<link data-require="bootstrap@4.0.5" data-semver="4.0.5" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" />
<div class="wrapper d-flex flex-column align-items-center justify-content-center">
<div class="top col-auto">Top Element</div>
<div class="middle col-auto">Middle Element</div>
<div class="bottom col-auto">Bottom Element</div>
</div>