【发布时间】:2012-12-22 15:06:24
【问题描述】:
使用Equal Height Columns with Cross-Browser CSS 示例
HTML:
<div id="container1">
<div id="col1">Column 1<br/>2</div>
<div id="col2">Column 2</div>
<div id="col3">Column 3</div>
</div>
CSS:
#container1 {
float:left;
width:100%;
}
#col1 {
float:left;
width:30%;
background:red;
}
#col2 {
float:left;
width:40%;
background:yellow;
}
#col3 {
float:left;
width:30%;
background:green;
}
还有更复杂的演示页面,但我希望将第一个示例用于我的目的。为什么示例不起作用?
【问题讨论】:
-
现在可以用flexbox解决“等高列”的问题了。
-
您选择的示例没有给出等高的列。它的描述是: > 这里是强制容器 div 到最长列的高度的 CSS。您需要使用博文末尾的最终版本才能获得您想要的效果 - matthewjamestaylor.com/blog/equal-height-columns-3-column.htm
标签: css multiple-columns equal-heights