html - CSS3、HTML - 如何像这样排列 block

标签 html css

<div class="outer-wrapper">
    <div class="inner-wrapper">
        <div class="item">1</div>
        <!--...-->
        <div class="item">12</div>
    </div>
</div>

.outer-wrapper {
    position: relative;
    min-width: 900px;
    max-width: 900px;
    min-height: 600px;
    max-height: 600px;
}
.inner-wrapper {
    position: relative;
    width: 20000em;
}
.item {
    min-height: 350px;
    max-height: 350px;
    min-width: 350px;
    max-width: 350px;
    background: cornflowerblue;
    font-size: 40px;
    float: left;
}

我已附上图片:

enter image description here

如何以这种方式排列元素而不将组(每六件元素)包装在额外的容器中?可能吗?

最佳答案

结合使用列数和 float :

http://jsfiddle.net/JqRv3/1/

ol {
    -webkit-column-count: 2;
    -moz-column-count:    2;
    column-count:         2;
}
li {
    list-style: decimal inside;
    width: 33.3333%;
    float: left;
}

关于html - CSS3、HTML - 如何像这样排列 block ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23300401/

相关文章:

html - 有时无缘无故我的 ul 位置较低

javascript - 如何使每个 `<li>` 具有不同的背景颜色?

javascript - 将选定的下拉菜单值传递到第二个函数

html - nth-of-type(2) 是针对第一个类型?

CSS 均匀分布高度和填充屏幕

css - 如何让两列垂直对齐?

javascript - 选择下拉菜单时在移动 View 中放置内容

html - 如何制作可变宽度的输入字段

javascript - 使用 javascript 将分层无序列表转换为选择列表

javascript - 表单验证不验证密码