Issue: I have a container set to 100vh, but as the screen size changes, I want the font size to adjust accordingly and always stay within the container without overflowing.
Thoughts: While I understand this can be achieved easily with @media CSS rules, I'm curious if it's possible to accomplish this without using @media or dynamically.
Fiddle: https://jsfiddle.net/wm0n4mys/
.container{
border:1px solid black;
text-align:center;
height:100vh;
}
h2{
font-size:60px;
}
*{
box-sizing:border-box;
padding:0;
margin:0;
}
<div class="container">
<h2 class="main">A compelling headline that illustrates a significant concept in a bold way</h2>
<p class="text">Exploring the depths of something profound while keeping it concise yet impactful.</p>
</div>