E
E
Egorian2018-05-09 08:48:02
css
Egorian, 2018-05-09 08:48:02

Where are the units of measurement used?

Where are the units of measurement used? I would like to know which options are better.
Font-vmin,vh
Padding, block sizes, images-%,vh,vw
Where are pixels used? I saw that they are used for text. Is it correct? I don’t use it for blocks, because it’s not adaptive, it seems to me.
In short, where are the units used according to the standard?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Spirin, 2018-05-09
@Egorian

Do you set the font size in vmin and vh ? What for?
Recent projects have mostly used rem . And in one, in general, mainly px and did not experience any problems.
Also, in one of the projects, they converted px to rem : Very interesting experience, but debugging is not very convenient. In the code 10px in the console is 0.625rem . Regarding use cases: rem, px are used for everything. vw, vh, vmin only for rare cases where viewport dependency is important . Interest
primarily for setting width, height, and absolute/fixed positioning.
Relative units (1.4) for line-height , for isolated elements and buttons/inputs, line-height can also be set in rem/px .
Many actively use em . It didn’t work for me, and they didn’t use it in projects, so I can’t say anything objective about this unit of measurement.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question