Page 1 of 1

But did you know that the same thing can be done with the fonts you use?

Posted: Sat Jan 18, 2025 5:59 am
by ceosakib
By doing this you were able to create an element and center it on the screen with just CSS code, all that was needed was to set the height of our container to 100vh. But there is one more effect I want to introduce you to…

Dynamic typography thanks to the vwevh
For now we have seen how to use these units of measurement in relation to the dimensions that an object can have. It is certainly a very interesting feature since it allows us to create elements that adapt to the dimensions of the window in a completely automatic way.


Several years ago, this article appeared on the great blog CSS Tricks, a site where HTML, CSS and JavaScript list of palestine consumer email reign supreme. Back in 2012, these units of measurement were being discussed, and while at the time we were forced to use JavaScript libraries like FitText (for compatibility reasons), nowadays we can easily set the size of our characters using the width of the viewport as a reference point.

CSS
1
h1 {
2
font-size : 5.9vw ;
3
}
In the course dedicated to the development of responsive websites I explained to you how important it is to use units of measurement remthat allow us to better modify the layout of the website, but if you are developing a single-column layout that guides the visitor to a vertical flow in consulting the contents, I recommend that you use the units of measurement described in this article.

This way you can easily resize your texts according to the size of the screen that loaded the page. This is the best way to resize text within any screen, but at the same time it is good to know how to use the units of measurement at the best time.