The height of the parent element is adaptive to the height of the absolutely positioned child element

Add overflow:hidden to the parent element, and add the following class:
.clearf:after{ content:''; display:block; clear:both; } After testing, this method does not work, if it is floating, it will work. Use relative positioning directly, you can also move the element position by changing the left attribute




Guess you like

Origin blog.csdn.net/weixin_44494811/article/details/96758272
Recommended