【发布时间】:2015-01-31 05:20:09
【问题描述】:
如何仅使用 css 和 html(无 js)制作具有相同高度的三列布局
【问题讨论】:
标签: html
如何仅使用 css 和 html(无 js)制作具有相同高度的三列布局
【问题讨论】:
标签: html
最简单的方法是使用faux column background technique。
您还可以尝试使用带有overflow: hidden 的容器为三个 div 提供大量底部填充和大量底部边距。不过,它与内联锚点效果不佳。
【讨论】:
<html><body>
<div>
<div style="float:left;height: 33.33%;width:10%;background-color:red">zdfsfs</div>
<div style="float:left;height: 33.33%;width:10%;background-color:blue">zgfsgsgfsgf</div>
<div style="float:left;height: 33.33%;width:10%;background-color:cyan">zvgzcxgvxz</div>
</div></body></html>
【讨论】:
div {display : table-cell;}
这可能是问题的另一个解决方案! 欲了解更多信息,请查看此链接:Is there a disadvantage of using `display:table-cell`on divs?
【讨论】: