想要將底部(綠色)容器放置在左側和右側容器(紅色和藍色)下方,但仍將其放在主(黑色)容器內。無法讓它工作。有什麼建議麼? (jsfiddle):將div放在兩個不同尺寸的其他div元素下面
<!DOCTYPE HTML>
<html>
<body>
<div class="main_container">
<div class="left_container">
</div>
<div class="right_container">
</div>
<div class="bottom_container">
</div>
</div>
</body>
</html>
CSS:
div.main_container {
background: #000;
border: none;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
-khtml-border-radius: 15px;
border-radius: 15px;
width: 100%;
min-height: 400px;
margin: auto;
position: relative;
}
div.left_container {
float:left;
position:absolute;
width: 220px;
background: red;
margin: 0;
min-height: 100%;
padding: 0;
}
div.right_container {
position: relative;
margin-left: 220px;
width: 715px;
height: 100px;
background: blue;
}
div.bottom_container {
width: 100%;
height: 100px;
background: green;
}
您的左容器設置爲最小高度:100%,那麼您如何期望將其置於其下? –
我需要左側容器來填充高度的其餘部分,這是我需要解決的問題。有任何想法嗎? – sooper