A
A
a16a2016-05-19 19:20:52
css
a16a, 2016-05-19 19:20:52

Which value is better in % or in px?

Hello. What is the best grid value? I saw some do percentage, others in pixels.
And which one is actually better? For a responsive site.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
Sergey, 2016-05-19
@a16a

and both are bad if you always blindly use only one thing.
It is good to combine them based on the task. For example, if you have a task to make the first column 340 pixels and stretch everything else, what do you think you will use?

F
fetis26, 2016-05-19
@fetis26

best in rem

E
Error 502, 2016-05-19
@NullByte

depends on the elements and on the intent in their design. if you plan to create a responsive site, then both percentages and pixels can be used. pixels are best used for elements whose design will not differ in the mobile version of the site and the desktop version. and percentages are for dynamically adaptable elements. For example, I'm creating a div that should have some padding from the right edge, changing its width and padding-to-width ratio of the element. then it's easier to apply percentages. At the same time, I can set the height of the same element in pixels and it will be displayed the same on both "versions" of the site.

D
Denis Bukreev, 2016-05-19
@denisbookreev

Of course interest is better
and it's stupid to argue with that

S
Schoolboy., 2016-05-19
@viphorizon

for responsive site css supports @media. Pixels or percentages? - a stupid question, each layout designer does it in his own way

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question