The vw unit stands for viewport width and scales the font size relative to the width of the browser window, making it ideal for responsive typography.
clamp() to create fluid typography that scales between 1rem and 3rem based on viewport width?The clamp() function takes three values: minimum, preferred, and maximum. Option C correctly sets the font size to never go below 1rem, scale with 2vw, and never exceed 3rem.
font-size: clamp(1rem, 5vw, 2rem);Note: 1rem = 16px.
5vw means 5% of viewport width. 5% of 500px is 25px. The clamp sets minimum 16px, preferred 25px, maximum 32px (2rem). So the font size is 25px.
Option D correctly lists all heading tags separated by commas. Options B, C, and D are invalid selectors.
Using relative units like rem respects user settings and allows zooming, improving readability and accessibility. Fixed pixels and disabling zoom harm accessibility.
