DIV fills the parent element vertically

<div class="parent" style="width: 100%; position: relative">

    <div class="left" style="position: absolute; top: 0; bottom: 0">1</div>

    <div class="right">12312312312121213</div>

</div>

 

To make the inner left div fill up the parent element vertically (height 100%), you can set the relative position to the parent element, and set the absolute position to the left, top 0, bottom 0;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326233274&siteId=291194637