Answer the question
In order to leave comments, you need to log in
Do you use fluid typography in website layout?
I drew up an example where three paragraphs change font-size at 480px and 600px.
.title1 is the easiest way when you refer directly to the element in a media query
.title2 is a more advanced way when you make the element dependent on html or body (defining element styles in em and rem) and just change the font in the media query -size html(body) and everything adjusts.
.title3 - smoothly changes font-size, have a look here
I know that the second way is quite popular, but what about the third one?
do you use it in layout?
are there any downsides to using the third way?
if you use it, then in order to set a smooth change only font-size or are there other "use cases"?
ps in the console monitors font-size changes of elements
Answer the question
In order to leave comments, you need to log in
@media screen and (min-width: 25em){
html { font-size: calc( 16px + (24 - 16) * (100vw - 400px) / (800 - 400) ); }
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question