K
K
kpa6uu2015-10-18 20:46:41
css
kpa6uu, 2015-10-18 20:46:41

How to prevent elements from "flowing" on top of each other when resizing the browser window?

Greetings! How it is possible to forbid "leakage" of elements on each other?
For example, if the element "leaks", then it is transferred to a new line, i.e. under the element on which it flowed?
Here, I sketched an example (in the first image, the browser window is open to full screen. In the second image, the window is reduced):
caec6a11242945ecb1e26643705ec488.pnga3a2f4b366c14b1db10f2f811102847e.png
Regarding this example, you need to make sure that the element "1" when flowing onto the element "2" goes up, and the element "3" when flowing element "2" went down.
I hope I explained clearly. Where to dig?)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Torbeev, 2015-10-18
@kpa6uu

If they showed a live example, it would be easier. There is an option to use @media.
With a screen resolution of max-width: 768, for example, make the width of the blocks equal to 100%, not 33%

M
Mr Crabbz, 2015-10-18
@Punkie

Well, so clear red - you are using position: absolute. In this scenario, the elements stop "pushing".
Either change absolute to floats or flex, or change the position of top, left, and so on through @ media at the desired screen resolution.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question