If you still don't see the usefulness of being able to use these units of measurement, here are some examples that I hope will help you take them into consideration.
Many designers and developers have always wanted to be able to place an element list of palestine consumer email in the center of a screen , with Flexbox we can easily solve this problem because the positioning of the element is really a breeze. All we have to do is set the container to place its elements centrally like this:
CSS
1
#container {
2
display : flex ;
3
justify-content : center ;
4
align-items : center ;
5
}
With the properties justify-contentand align-itemswe can say that the elements contained inside must be centered for both axes , but one of the first problems that arises is due to the height of our container that will adapt to the content present inside it. In all this, however, there is a problem…
If we try to set the container height to 100%, absolutely nothing happens! How do we solve this first puzzle?
The solution is very simple and just relies on the units of measurement that we have just discovered . All we are required to do is set the height to 100% of the viewport, or to100vh.