在我正在设置的博客上,http://beerwhich.com/blogFun/index.html ,我正在使用 column-width 属性来创建水平阅读体验。
问题:尽管两个帖子都是 float 的,但我似乎无法让多个帖子彼此水平相邻显示。
任何建议/知识将不胜感激!
最佳答案
@肖恩; column-width
没有问题属性只是给你的宽度 .container div
(父 div)为 child
腾出空间分格
例如:
.container {
height: 100%;
overflow: hidden;
padding: 20px 0 0 100px;
width: 4270px;
}
编辑:
正如您所说,您不想为您的 div 指定宽度。所以,也许你可以做到这一点
CSS:
.container {
white-space: nowrap;
}
.post {
display: inline-block;
padding: 110px 0 0;
white-space: normal;
}
.post .text {
-moz-column-count: 3;
-moz-column-gap: 20px;
-moz-column-width: 320px;
height: 500px;
}
.column {
display: inline-block;
}
检查是例子http://jsbin.com/oruyir/18给column-count:
根据您的文本属性。
关于css - 为什么在使用 -moz/webkit 列宽 CSS 时不能将多个帖子并排放置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7376018/