David Debnar
David Debnar

Reputation: 125

Div won't resize

CLOSED

I made it by switching 2 of the children to absolute, because they will never expand, than I putted the children whom size wont change to the top and than I moved the last one upwards by few pixels so it overlays and still can resize the parent.

Upvotes: 0

Views: 808

Answers (1)

Philip Schweiger
Philip Schweiger

Reputation: 2734

Elements that are absolutely positioned do not take up any space, so changes to the number or size of the children will have no effect on the size of the parent element.

If you want the parent container to expand/contract with its children, you need to float both the container and its children.

Upvotes: 1

Related Questions