Looking at the HTML code below:
<div class="section-cover dark-cyan" ng-style="{height: getCoverHeight()}">
<div class="container">
<h1 class="intro">Some intro text.</h1>
</div>
<div class="arrow-holder" ng-click="scrollTo('video-container');">
<span class="arrow"></span>
</div>
</div>
The .section-cover
div's height changes dynamically based on viewport size whenever the browser is resized. The goal is to align the <h1>
element vertically inside the section-cover
div. Using display: table-cell
helped achieve vertical alignment but maintaining a width of 100%
seems challenging. Here's an example in JSFiddle:
Any suggestions on how to tweak this to ensure vertical alignment of the <h1>
while keeping the width at 100%?