考虑以下HTML:
<div class='x'>
<ul>
<li>Number one</li>
<li>Number two</li>
<li>Number three</li>
<li>Number four is a bit longer</li>
<li>Number five</li>
</ul>
</div>
和以下CSS:
.x {
-moz-column-count: 3;
column-count: 3;
width: 30em;
}
就目前而言,Firefox呈现的内容与以下类似:
• Number one • Number three bit longer
• Number two • Number four is a • Number five
注意,第四项在第二和第三列之间分配。我该如何预防?
所需的渲染可能看起来更像:
• Number one • Number four is a
• Number two bit longer
• Number three • Number five
要么
• Number one • Number three • Number five
• Number two • Number four is a
bit longer
编辑:仅指定宽度以演示不需要的渲染。在实际情况下,当然没有固定的宽度。