我正在处理一个有序列表,其中包含一系列 li 标签,条目长度各不相同。我想把它们分成两列(现在不使用列数)。我想要实现的是:
Item 1 Item 2
Item 3 so Item 4
long it overflows
Item 5 Item 6
Item 7 also too Item 8
long but isn't such
a problem on right
但这就是我得到的最好结果。
Item 1 Item 2
Item 3 so Item 4
long it overflows Item 5
Item 6 Item 7 also too long but
isn't such a problem on right
Item 7 Item 8
无论我尝试什么, float 、显示:内联等等,我最多只能得到我的第一个例子。谁能想出一种在 CSS 中执行此操作的简洁方法?
编辑:jsfiddle 在这里:http://jsfiddle.net/c0rLqqbw/1
最佳答案
根本不要使用列。尝试:
.myContainer li {
float: left;
width: 50%;
}
关于css - 两列中的有序列表,其中包含一些长条目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27640571/