How HTML supports the height of floating parent elements

This article shared everyone about how HTML supports the height of floating parent elements. Xiaobian feels quite practical, so share it with you to do a reference. Let’s take a look at Xiaobian.

When we set float not a property value of None, it will cause the parent element to highly collapse

The parent element is just no height; then the father at this time The element is not high.

The height of its parent element is insufficient, resulting in sub-elements overflow;

When we give Li element height, the height of UL is 0


Opening BFC:

Setting this element overflow attribute to remove the attribute value of Visible

set the FLOAT attribute of the element to remove the attribute value of NONE

Set the element to absolute positioning Absolute

Set the element’s Display property set to: Inline-block or Table-Cell, Flex, Inline-Flex

Clear floating

Add appropriate heights to parent elements

Thank you! With regard to how HTML supports floating parent elements, sharing here, I hope that the above can help everyone, let everyone learn more knowledge. If you feel that the article is good, you can share it out to let more people see it!

© Copyright Notice
Just support it if you like
comment Grab the couch

Please log in to comment