Struggling to vertically align multiple position:absolute divs in the middle? Even with width and height set at 100%, they still overflow. Any solutions or suggestions would be greatly appreciated. Thank you!
<div class="wrapper">
<div class="wrapper-inner>
<div class="section-1">
<h2>Title Here</h2>
<p>Lorem ipsum dolor sit amet.</p>
</div>
<div class="section-2">
<p>More text here.</p>
<p>And more.</p>
</div>
</div>
</div>
html,
body {
width: 100%;
height: 100%;
}
.wrapper {
width: 100%;
height: 100%;
}
.wrapper-inner {
width: 100%;
height: 100%;
position: relative;
}
.section-1 {
position: absolute;
left: 20vw;
width: 40vw;
background: #ccc;
}
.section-2 {
position: absolute;
left: 60vw;
background: #375642;
width: 40vw;
}
View demo here
Can't seem to figure out how to center those content sections vertically on a full screen height without using top:50% and adjusting for height, which isn't ideal for responsiveness.