▪ ▪2015-09-20 16:01:08
css
▪ ▪, 2015-09-20 16:01:08

Is it normal to make the whole page of the site in position absolute?

For some reason, I often meet people who say that position absolut is not very good. Why is it worse than relative? The fact that it cannot move neighboring blocks? For example, I am now making a site page with a description for the entire width of the screen, and I want to make all the main blocks position absolut.
Of course, someone will say that you can use float left and float right, but it seems completely inconvenient to me because when you start scaling the browser width, these blocks become one under the other. We have to do frequent @media screen and (max-width), which is much more than we would have to do for divs with absolute values.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vitaly Inchin ☢, 2015-09-20
@kingdomofcrooked

CSS is about the magic of the correct arrangement and appearance of elements on the page, and not the banal indication of coordinates for them. Each ability of this magic should be used in certain situations, and not shove the same thing everywhere.
Yes, building content using position:absolute seems simpler - "put two numbers and an element where you need it, yyyy..." , but what seems much more complicated in the end may be the most elementary and convenient solution to your problem.
And the fact that the blocks lying after it ignore it entirely. And it will not be possible to build more than one normal layout on one absolute positioning.
------------------------------------------
Relative - сдвигает блок из его первоначальной позиции на заданную величину в заданное направление, НО, не знаю, можно ли так сказать, лишь визуально - блоки, идущие после "видят" его на старой позиции, но учитывают его размеры.
Absolute - отделяет элемент от остального мира, устанавливает ему заданные координаты, отсчет которых начинается с верхнего левого угла ближайшего родителя с position:relative|absolute|fixed.
------------------------------------------
-
And what does this have to do with it?
And without absolute even less :\
-----------------------------------------
I I am by no means declaring that absolute is evil. You should use it, but only where it is needed. But you still stick it everywhere, right? :)

A
al3ch5, 2015-09-20
@al3ch5

To hell, unequivocally to hell for such misfortunes of layout designers ....
Then a request comes to freelancing: to finalize the "mobile site", to limit the "site for mobile devices". You open it, and there is such a miracle of chess... and you understand... In short, you don't understand anything anymore and cry, knowing that you need to redo it!

P
Pavel K, 2015-09-20
@PavelK

It's like putting together a Rubik's cube by sticking stickers.

T
Therapyx, 2015-09-20
@Therapyx

Why complicate your life with junk? Of course, you can still ride a Muscovite. From the very beginning they began to accustom me that all sorts of absolutes are evil.
Don't seriously break your head about this. Just take it and forget :) Use floats and don't worry.
Even tr td table tables are essentially "old". I loved them, while according to the standards of some committees there (I didn’t go into details), in order to make the web epka the standard for many companies, they harnessed me to change the entire tabular laugh (for 100+ files) from tr, td, table to a block structure, and even so that everything remains unchanged by eye, i.e. pixel to pixel - that's where the hell and the crap was.
So believe me, in our time it is better to move away from this nonsense and fill your head with more useful things.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question