CLOSED
I made it by switching 2 of the children to absolute, because they will n开发者_开发百科ever 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.
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.
精彩评论