Vertical align div to viewport height
Hey all.
I have a div and a wrapper -
HTML Code:
<div class="lTagLineWrapper">
<div class="iTagLine">
</div>
</div>
that is positioned absolutely from the top of the page.
Code:
.lTagLineWrapper {
position:absolute;
left:50%;
top:40%;
}
.iTagLine {
position:relative;
left:-50%;
width:600px;
text-align:center;
font-size:3em;
background-color:red;
}
to put the iTagLine in the middle of the screen even while zooming.
Only problem is when you scroll down the page, the div stays in its position on the screen (because of the position:absolute;).
Any way to position it relative to the top of the page without impacting the flow of other elements on the page without using position:absolute;? (or some other fix)
Thanks,
keyboard