Javascript to turn an unordered list into multiple columns

后端 未结 7 654
忘掉有多难
忘掉有多难 2020-12-29 11:55

There doesn\'t seem to be an easy way in (well supported) css to do this. I\'m looking for a javascript solution, preferably jQuery.

I have an unordered list like th

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-29 12:38

    See this article:

    One of the minor holy grails of XHTML and CSS is to produce a single, semantically logical ordered list that wraps into vertical columns.

    I’ll warn you up front. If you want to present a list in multiple columns, you’ll have to compromise. You can sacrifice W3C web standards and use deprecated markup, you can live with markup that’s less than semantically logical, you can tolerate a mixture of presentation with content, you can say goodbye to browser compatibility, or you can use markup that’s heavy with attributes and styling that’s heavy with rules. Every road exacts a toll.

    http://www.alistapart.com/articles/multicolumnlists/

    The "best" solution is subjective, but I'd be inclined towards arbitrary classes.

提交回复
热议问题