Scale Section test
testing variable height solutions inside a container.
by sebastianauer
HTML
<div class="outer">
<div class="innerwrap">
<div class="headings">
<span>Line 1</span>
<span>Line 2</span>
<span>Line 3</span>
<span>Line 4</span>
</div>
</div>
</div>
CSS
.outer {
outline: 1px solid red;
padding: 10px;
margin: 10px;
background: url(https://picsum.photos/id/287/1920);
background-repeat: no-repeat;
background-position: center;
background-size: 100%;
height: calc(33*(100vw/75));
}
.innerwrap {
outline: 2px dotted green;
position: relative;
height: 100%;
}
.headings {
position: absolute;
width: auto;
outline: 2px dashed blue;
display: flex;
flex-direction: column;
top: 20%;
left: 10%;
}
.headings span {
color: white;
font-weight: 600;
font-size: calc(100vw/25);
}