I would like to have the div centered in the body. It works if I change 100% to 100vh. I would like to avoid using 100vh as I want these rules to be usable within a container. Why does 100% expand the height for the background but not for the purposes of vertically centering the div?
head + * {
margin: 0;
display: flex;
align-items: center;
justify-content: center;
background-color: #cb9800;
height: 100%;
}
.content {
font-family: Comic Sans MS;
font-size: 75%;
}
<div class="content">This is vertically centered if I change 100% to 100vh</div>