Try resizing your browser window to see how the font size scales up and down dynamically
the vw unit means Viewport WidthThis is the code used above
<h1 style="font-size:8vw;">Big Fonts</h1> <p style="font-size:2vw;">Try resizing your browser window to see how the font size scales up and down dynamically</p> the vw unit means Viewport Width</p>
If you are familiar with @media CSS property, then this is the same but its my simpler.
check the screen size is 401px wide or more, set the font-size of <div> to 80px @media screen and (min-width: 401px) { div.example { font-size: 80px; } } check the screen size is 400px wide or less, set the font-size of <div> to 30px @media screen and (max-width: 400px) { div.example { font-size: 30 px; } }