Div在两列 [英] Div's in two columns

查看:88
本文介绍了Div在两列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有多个div,这取决于它使用的数据。目前他们在一个容器div中,它们的宽度是容器的一半,有一个左浮点,所以它们显示如下:

I have multiple number of divs that varies depending on the data it is using. Currently they are in a container div, and their width is half the container with a left float so they appear like:

1 2
3 4
5 6
7 8
9

等。

我试图让它看起来像:

1 6
2 7
3 8
4 9
5

我似乎找不到一个简单的方法来做到这一点。

I can't seem to find a simple way to do this.

推荐答案

约瑟夫;您可以像这样使用css3 column-count 属性

@joseph; you can use css3 column-count property like this

    div#multicolumn1 {
        -moz-column-count: 2;
        -moz-column-gap: 50%;
        -webkit-column-count: 2;
        -webkit-column-gap: 50%;
        column-count: 3;
        column-gap: 50%;

}

检查此示例http://jsfiddle.net/sandeep/pMbtk/ 可能有助于您

check this example http://jsfiddle.net/sandeep/pMbtk/ may be that's help you

这篇关于Div在两列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆