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

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

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

\"enter

But

9条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-30 08:38

    This works just fine cross-browser, no JS required. You just limit the width of your columns.

    
    
    
    • 1(li)
    • 2(li)
    • 3(li)
    • 4(li)
    • 5(li)
    • 6(li)
    • 7(li)
    • 8(li)
    • 9(li)
    • 10(li)

    If you are stuck with them all in one UL on page load, you can split them out with jQuery to create the same results:

    
    

提交回复
热议问题