How TO - Responsive Text
Learn how to create responsive typography with CSS.
Resize the browser window to see how the font size scales.
Responsive Font Size
The text size can be set with a
vw unit, which means the "viewport width".
That way the text size will follow the size of the browser window:
<p style="font-size:2vw;">Resize the browser window to see how the font size scales.</p>
Viewport is the browser window size. 1vw = 1% of viewport width. If the viewport is 50cm wide, 1vw is 0.5cm.
Tip: Go to our CSS Font Tutorial to learn more about fonts.