How to make the automatic DIV height changeable even if the content is absolute?

I have a container div that is equal position:relativeto and squares position:absolute, because I want to play with my positions.

alt text

Like what you see, the container does not match the contents, except that the squares are located in Relative, is there a solution for this?

I don't want to just set the height for the container, because the squares are not static, so I want something that automatically resizes.

thank

+3
source share
3 answers

Unfortunately, it is not possible to contain absolute positioned elements. They are completely out of the normal flow, so no one knows how to wrap them.

+2

, , , .

, , , , , "" , ?

, DIV , clear:both, . , , , , .

,

0

, "" div top . , , , , .

0
source

Source: https://habr.com/ru/post/1736589/


All Articles