[英]CSS two horizontal divs equal height
<div>
<div>
hello1
</div>
<div>
hello2
</div>
</div>
I want the two inner div
's to take/fill up the whole space of the outer div
(height/vertically).我希望两个内部
div
占据/填充外部div
的整个空间(高度/垂直)。 But both inner div
's should have the equal height但是两个内部
div
应该具有相同的高度
You can use CSS' flexbox
, see my example below:您可以使用 CSS 的
flexbox
,请参阅下面的示例:
.row { display: flex; } .col { border: 1px solid; flex: 1; }
<div class="row"> <div class="col"> hello1 </div> <div class="col"> hello2<br> same height! </div> </div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.