Text size can be specified using the “vw” unit, representing the “viewport width”.
This ensures that the text size adjusts according to the dimensions of the browser window.
Example
<h1 style=”font-size:10vw”>Hello World</h1> |
The viewport refers to the size of the browser window. In this context, 1vw equals 1% of the viewport width. For example, if the viewport is 50cm wide, then 1vw would equate to 0.5cm.