DEV Community

Discussion on: CSS Interview Questions Feedback

Collapse
 
willzmu profile image
Wilfred

It's a really good exercise. Not hard at all.

A possible addition:
What unit would one use for font-size and why?

Collapse
 
anduser96 profile image
Andrei Gatej

IMO, it is recommend to use ‘rem’ and that’s because the value will depend on the root element’s font.
With that in mind , you can easily achieve text responsiveness just by changing the font size of the html element on different screens.
I’m also aware of a trick, that I’ve never used though and so I’m not 100% sure of what benefits it brings: use font-size: 62.5% on html element so you can make sure your text is still responsive even if the user’s browser has set a custom font size. I might be wrong on this use-case, so please correct me if I’m wrong!

Collapse
 
willzmu profile image
Wilfred

thanks, I will give 'rem' a try.

Collapse
 
vuild profile image
Vuild

Correct.
rem and em are generally the way forward.

62.5% used to be to set everything to a base size, not relevant anymore really. It pre-dates responsive design.