在没有使用 css 的脚本的情况下,红色块必须填充黄色和绿色之间的整个空间。除容器外,块的高度未知
div {
border: solid 1px black;
}
#container {
width: 100%;
height: 150px;
position: absolute;
}
#d1 {
background-color: yellow;
}
#d2{
background-color: red;
}
#d3 {
width: 100%;
position: absolute;
bottom: 0;
background-color: green;
}
<div id="container">
<div id="d1">1</div>
<div id="d2">2</div>
<div id="d3">3</div>
</div>