One of the most common cases involves using vh
for setting the height of a div
, and using vm
for adjusting font size.
Using CSS3
div.outer { height: 20vh; }
div.inner { font-size: 3vw; height: auto; }
div.inner2 { font-size: 2vw; }
HTML - Scenario 1
<div.outer>
<div.inner>center me!</div>
</div>
HTML - Scenario 2
<div.outer>
<div.inner>center me top!</div>
<div.inner2>center me bottom!</div>
</div>
Are there any possible ways to incorporate calc()
and other CSS3 properties to vertically center the div.inner
within the div.outer
?