我需要.col
爲.row
高度的100%,但您可以看到第二個.col
不足。我怎樣才能得到這個工作,而不使用任何「幻數」?如何使內部的高度父母未知身高全高?
.row {
position: relative;
background: #f99;
}
.col {
margin: 0 0 0 8px;
display: inline-block;
width: 40%;
position: relative;
vertical-align: top;
background: #999;
height: 100%;
}
.col:first-child {
margin: 0;
}
.item {
display: block;
position: relative;
top: 0;
margin: 12px 0 0 0;
min-height: 80px;
width: 100%;
outline: 4px solid black;
}
.item:first-child {
margin: 0;
}
.item.large {
min-height: 120px;
height: 100%;
}
.item.red {
background: #f00;
}
.item.blue {
background: #0f0;
}
.item.green {
background: #00f;
}
<div class="row">
<div class="col">
<div class="item red"></div>
<div class="item blue"></div>
</div>
<div class="col">
<div class="large item green"></div>
</div>
</div>
你能告訴我們還是畫出你期望的結果? –