The solution to the floating of the child element in CSS and the inability to automatically stretch the parent element

<div>
    <div style="float:left;">left</div>
    <div style="float:right;">right</div>
</div>

As shown in the above code, the height of the parent div does not increase with the height of the two child divs. Solution:

Add an overflow:hidden attribute to the parent div. as follows:

<div style="overflow:hidden;">
    <div style="float:left;">left</div>
    <div style="float:right;">right</div>
</div>

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327041023&siteId=291194637