1vw should be 1% of the viewport width. This works great except on font-size. When I set 50vw on a font-size, the font is not 50% of the viewport.. unless I am not understanding how font sizing works.
.test {
background-color: wheat;
width:50vw;
}
.test span {
display:inline-block;
font-size:50vw;
background-color: turquoise;
}
<div class="test">
<span>T</span>
</div>
In this simple example, you can see how the width of the container is set to 50vw, and is exactly 50% of the viewport.
However, the text inside the span, which is only one letter, is not 50% of the viewport. Why?
If I add more text, it will exceed the 50%, so I only left 1 letter, because I thought font-size applies to letters, so I thought a single letter would be 50% of the viewport, but It's not.
What am I not understanding here?