How to make floating DIV list appear in columns, not rows

前端 未结 5 613
-上瘾入骨i
-上瘾入骨i 2020-12-03 04:24

I have a HTML layout puzzle on my hands. I have a large alphabetical list, generated by my PHP app, and I need to output it on a web page. The markup generated look like thi

5条回答
  •  既然无缘
    2020-12-03 04:41

    You don't need to use float for the items, but maybe for a box where the items are located in, try this:

    A
    B
    C
    D
    E
    F
    G
    H
    .list_item { margin: 5px; padding: 5px; border: 1px solid gray; width: 200px; /*float: left;*/ }

    Edit: now with 2 columns :)

提交回复
热议问题