Is there a rule in HTML5 that does not allow for a child of a parent with height set in vh to have a % height?
I am setting an image to 100% height where a parent container has a height of 20vh. This works great if I don't specify the <!Doctype html>
, but once I add that code then the img heigh CSS is ignored and it defaults to the native image size.
header {
width: 100%;
background-color: rgba(255, 255, 255, 0.9);
z-index: 10;
height: 20vh; }
#mainLogo {
text-align: center; }
#mainLogo img {
height: 100%;
width: auto; }
<header>
<div class="container">
<div id="mainLogo">
<a href="#">
<img src="img/mainLogo.png"/>
</a>
</div>
</div>
</header>
Thanks in advance