简体   繁体   English

伸展 <div> 达到父母的全高 <div>

[英]Stretch the <div> to the full height of the parent <div>

There are many div blocks. 有很多div块。 One parent, the second inside the left (for the menu), the second inside the right (for the text). 一位家长,第二位在左侧(用于菜单),第二位在右侧(用于文本)。 How it is possible to stretch the right inner block (it is possible with the left one) to the entire height of the parent block. 如何将右边的内部块(左边的块可能)拉伸到父块的整个高度。 The parent block it has min-height:1100px 最小高度为1100px的父块

Here's the code: 这是代码:

<div id="wrapctr">
    <div id="leftmenu"></div>
    <div class="rightcontent">
        //common div
        <div style="padding: 10px; width: 100%; overflow: hidden; display: flex; flex-wrap: wrap; justify-content: space-between; background:white">
            // img div
            <div style="float: left; padding: 10px; text-align: center; width: 257px;"><img src="../img/1625.jpg" width="200"></div>
        </div>
    </div>
</div>

CSS CSS

#wrapctr {
    width:80%;
    min-width: 700px;
    max-width: 1200px;
    background:#FFF;
    margin:0 auto;
    min-height:1100px;
    z-index:2;        
}

#leftmenu { 
    background: #FFF;
    float: left;
    width: 250px;
    list-style: none;
}
.rightcontent {
    background: #FFF; 
    margin-left: 255px; 
}

One page show 12 images are issued in three in a row. 一页显示连续三张发行12张图像。 If i added position:relative and absolute with height:100% my div with style comes out of rightcontent div 如果我添加position:relativeabsolute height:100%我的样式div来自rightcontent div

您应该为您的常用div赋予wrapctr相对位置和绝对位置,然后就可以为常用div赋予高度100%

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM