Wrap a list to the right

前端 未结 3 836
执笔经年
执笔经年 2021-02-13 22:24

If i had a list like the following:

  • Alex
  • James
  • Thomas
  • Is
相关标签:
3条回答
  • 2021-02-13 22:46

    Afaik this is not possible with CSS2. Especially if you want to keep the order like you mentioned it.

    However there is a jQuery Plugin that does exactly what you descripted.

    http://www.christianyates.com/blog/mmm-geeky/multi-column-lists-jquery-alternative-method

    0 讨论(0)
  • 2021-02-13 22:49

    For modern browsers

    ul{
        -ms-column-count: 2;
        -o-column-count: 2;
        -moz-column-count: 2;
        -khtml-column-count: 2;
        column-count: 2;
        }
    
    0 讨论(0)
  • 2021-02-13 23:02

    If you would like set width for every <li> and lost order of elements, here is demo: http://jsfiddle.net/dpXz2/

    li{
        display: block;
        float: left;
        width: 75px;
    }
    
    ul{
        width: 150px;
    }
    
    0 讨论(0)
提交回复
热议问题