Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 垂直拉伸DIV_Html_Css - Fatal编程技术网

Html 垂直拉伸DIV

Html 垂直拉伸DIV,html,css,Html,Css,我在这里创作了一把小提琴: HTML: 206 805 15 安德斯·布赫·拉森 克诺克勒,克诺克勒,克诺克勒! 伯德·吉森。伯德·吉森。伯德·吉森。 伯德·盖森。伯德·盖森。伯德·盖森。 伯德·盖森。伯德·盖森。伯德·盖森。 我希望左侧的灰色框向下延伸到包装器div底部的蓝色边框。随着右下角框中添加了更多内容,它应该会继续延伸。如何做到这一点 .incidentCellLeft { max-height:200px; width: 50px; display: bl

我在这里创作了一把小提琴:

HTML:


206 805
15
安德斯·布赫·拉森
克诺克勒,克诺克勒,克诺克勒!
伯德·吉森。伯德·吉森。伯德·吉森。
伯德·盖森。伯德·盖森。伯德·盖森。
伯德·盖森。伯德·盖森。伯德·盖森。
我希望左侧的灰色框向下延伸到包装器div底部的蓝色边框。随着右下角框中添加了更多内容,它应该会继续延伸。如何做到这一点

.incidentCellLeft
{
    max-height:200px;
    width: 50px;
    display: block;
    float:left;
    text-align: center;
    background-color: #E6E6E6;
    vertical-align: bottom;
    height:100%;
    position: absolute;
}
高度:100%
位置:绝对已添加。此处演示:


此外,您应该删除
最大高度:200px如果要将其拉伸到200像素以上的高度。

无需更改任何东西的高度。只需将容器的
背景色设置为灰色,将右侧单元格的背景色设置为白色:


在css中,您是否尝试过高度:100%?如果您尝试了
float:left它阻止对象与其容器的上下文具有任何高度。试着用
display:inline块来布置这个布局并确保边距合理。是的,我尝试了100%并显示:inline-block。谢谢,到目前为止有三种不同的解决方案。你更喜欢哪一个?或者也许是无关紧要的?
.incidentCellLeft
{
    max-height:200px;
    width: 50px;
    display: block;
    float:left;
    text-align: center;
    background-color: #E6E6E6;
    vertical-align: bottom;
    height:100%;
    position: absolute;
}