如何为两个不同的元素做相同的高度? [英] How can I make the same heights for two different elements?
本文介绍了如何为两个不同的元素做相同的高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下代码,我的row_container div包含左和右div。
我很难获得行容器与嵌套的左和右divs相同的高度..我失踪了?
我试过height:auto;没有工作。
我需要该行具有坚实的背景颜色
I have the following code, my row_container div's hold the left and right divs.
I'm struggling to get the row containter to have the same height as the nested left and right divs.. what am i missing?
I tried height:auto; didnt work.
I need the row to have a solid background colour
.row_container{
margin:auto;
width:420px;
background-color:#FFFFFF;
padding-top:15px;
padding-bottom:15px;
clear:both;
}
.left_row{
float:left;
width:200px;
padding:5px;
}
.right_row{
width:200px;
float:right;
text-align:justify;
padding:5px;
}
推荐答案
code>溢出:隐藏到您的 .row_container
Add overflow: hidden
to your .row_container
这篇关于如何为两个不同的元素做相同的高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文