CSS 2 div大小自动相同高度 [英] CSS 2 div size auto same height
问题描述
我在CSS中有一个问题:
i have an question in CSS:
我可以这样做:
当绿色div具有(自动)500px高度
When the green div has (auto) 500px height for the content the red got the same.
当红色的内容高度为700px(绿色)时,绿色的内容相同。
And when the red has (auto) 700px height for the content the green got the same.
两个都有任何内容,然后我使用自动高度。
Both have any content then i use auto height.
所以我怎么做绿色有相同的宽度红色和红色,惠普不同的内容惠特height:auto;?
So how i can do the green has the same width as red and red too but whit different content whit "height: auto;"?
推荐答案
在父DIV上显示,然后调整父VI的大小
I would just wrap both DIVS, inside another div, and have them bump up on the parent DIV, then resize the parent
这样的东西....然后使用CSS格式化
Something like this.... then use CSS to format them
<div id=parent>
<div id=child>
Content....
</div>
<div id=child>
Content....
</div>
</div>
其他一些解决方案可以在这里列出
http://www.ejeliot.com/blog/61
some other solutions could be listed here http://www.ejeliot.com/blog/61
这篇关于CSS 2 div大小自动相同高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!