I
I
Islam Ibakaev2017-02-13 14:22:16
css
Islam Ibakaev, 2017-02-13 14:22:16

How do you use relative units when laying out pages?

Do you use them at all? To solve what problems? Why is using pixels not enough?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
I
Ivan Bogachev, 2017-02-13
@devellopah

Lately everything is only in rem/em. From the goodies - the font size smoothly changes when the screen size changes ( article on smashingmagazine, suddenly someone hasn’t read it yet), we don’t think about the exact sizes of indents for text, buttons, or whatever - the very way of thinking becomes different - everything is measured in rem - 0.75, 1, 1.25, 1.5, 1.75, 2, 3, 4, 5... You can make up without a designer (without a layout) according to some sketches and it will look beautiful. You can change things like border-radius depending on the size of the font currently being used: the larger the screen, the larger the letters, and the larger the border-radius (or border-width, or some other property). The grid can also be transformed not at certain screen resolutions, but by rem (at a certain line length) - few think about it, but if you design content-first - this can be very convenient.
Of the features - the designer must think the same way, then you will have complete harmony and mutual understanding with him.

R
Rafael™, 2017-02-13
@maxminimus

most often pixels
sometimes percentages
very rarely em

M
Mikhail Osher, 2017-02-13
@miraage

https://habrahabr.ru/post/280125/

S
Sanes, 2017-02-13
@Sanes

Check out the new version of Uikit . TB 4 also does not hurt to look.
Just fought with the retina in these versions.

E
Egor Zhivagin, 2017-02-13
@Krasnodar_etc

Only pixels, only hardcore)) In fact, using flex and grid, pixels are almost enough. I rarely remember percentages.
And em / rem should first start using the designer, then I) Although the thing is cool, it would be very convenient to set the height of the blocks containing text

A
Alina Brann, 2017-02-13
@alina_ivanovna

em and rem, have recently appreciated their importance. The convenience lies in the fact that you set the font size in one place, all other sizes are formed relative to it. This is useful when you need, for example, to reduce the font to 1280 screen width so that everything does not look gigantic. And in order not to sit and calculate the ratio of px to rem, you can use an online converter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question