I want to show list items as 2 or more columns (dynamic alignment)

前端 未结 9 2045
无人及你
无人及你 2020-11-30 07:50

I am able to do the list using float:left; like this

\"enter

But

9条回答
  •  自闭症患者
    2020-11-30 08:37

    I found a way to do this in IE too. (using clear)

    html:

    1
    5
    2
    6
    3
    7
    4
    8

    css:

    .child {
        height:20px;
        width: 20px;
        text-align: center;
        border: 1px solid #CCC;
        background-color: #EEE;
        color: #000;
        padding: 5px;
        float: left;
        margin: 5px;
    }
    .left {
        clear: left;
    }
    

    See http://jsfiddle.net/pMbtk/31/

提交回复
热议问题