S
S
smoklew2015-10-03 09:37:08
css
smoklew, 2015-10-03 09:37:08

Why can't it be comfortable?

Why can't you do something like this, so that if the browser window is reduced/enlarged, the elements on the site, depending on this, would proportionally increase or decrease.
For example, they would make all sites at a resolution of 1920x1080 and when the window was reduced, all elements would automatically shift, shrink, at any resolution ...
You can also come up with such a thing as coefficients that will have a dependence ( 1920 / on the resolution that the user has, suppose (1366) , it turns out the coefficient ~ 1.4 and automatically divide all the element values ​​by this coefficient, isn't it possible to automate this
?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
C
Cat Anton, 2015-10-03
@27cm

Why invent such complex things as media queries and so on?

It seems that you could not deal with these "things" and now you want everything to adapt to you and make your life easier. But, unfortunately, we live in a cruel world without ponies and unicorns.
Media queries, flexbox, and relative units of measure allow developers to make websites that look exactly the way the designer intended on different devices. The introduction of some standard ratio, 1.4 or any other, is nonsense, because it is impossible to fit absolutely everything into one "magic" ratio that will suit everyone, if only because sometimes website elements on screens with lower resolution are made smaller, and sometimes vice versa - larger.

L
littleguga, 2015-10-03
@littleguga

There is one, discover vw/vh .
And media queries are needed because the arrangement of elements on the 1920 screen will be different from the arrangement on the screen of a mobile phone. You won't cram a video with a width of 1080 and beautiful pictures on the sides, so you need to rebuild the structure (relatively rebuild).
For automatic rebuilding of elements - you can flex + vh / vw.

A
Alex K, 2015-10-03
@alexk111

In this concept, the text will be small to the point of unreadability on phones. Or excessively huge at high resolutions.

I
Ivanq, 2015-10-03
@Ivanq

If you specified sizes not in px / pt, but in percentages, everything would be fine. Pixels for that and pixels that will look the same everywhere

E
Elizaveta Borisova, 2015-10-03
@Elizaveta

Why can't you do something like this, so that if the browser window is reduced/enlarged, the elements on the site, depending on this, would proportionally increase or decrease.

What you described is elementary, even without JS, but full "rubber" does not work functionally and visually. For example, fonts and sizes of objects are not suitable for tablets/mobiles (if resized, or they won’t fit on the screen), clickable elements should be easy to click on the phone, and not with tension, etc. That is, we are talking about a separate design, and media queries are a simplified way to implement it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question