我的问题是基于 css: set the height of floating divs as maximum of their heights - Is it possible to fix this jsFiddle with pure css so that all 3 divs that are in the same row have the same height, the maximum of their 3 heitghts?CSS:设定浮动的div的高度与利润率
的解决方案是here - jsFiddle。
但是,我没有提到我需要一些元素之间的边距(因为不重要和容易添加)。因此,建议使用display:table-cell
解决方案。不幸的是,保证金财产不适用于display:table-cell
元素。
是否仍然有可能解决我的问题之间的空间之间的一些空间纯css? 原始代码在这里,我想所有三个div的高度是相同的,他们之间有一些空间,比如说3px
。
的代码是在这里:
<style>
#main{
border:1px solid red;
width:605px;
overflow:hidden;
}
#zero{
border:1px solid blue;
}
.small{
border:1px solid green;
float:left;
width:199px;
}
</style>
<div id="main">
<div id="zero">
0
</div>
<div class="small">
small text
</div>
<div class="small">
large text large textlarge textlarge textlarge textlarge textlarge textlarge textlarge textlarge textlarge textlarge textlarge text
</div>
<div class="small">
another small text
</div>
</div>
这里是原来的问题@jsFiddle。
再次,如果可能的话,我宁愿选择一个纯粹的css解决方案。
这可能有助于:http://stackoverflow.com/questions/18346083/space-between-divs-display-table-cell –
但是,如果你考虑使用JS的任何机会:http://stackoverflow.com/a/18362090/1725764 –