Make CSS Drop Down Menu 2 Columns

后端 未结 3 448
挽巷
挽巷 2020-12-30 09:54

I currently have a css

  • dropdown menu that uses the following code. Unfortunately I want the sub menus to display in 2 columns as there are
相关标签:
3条回答
  • 2020-12-30 10:39

    To make the listings display alpha down instead of across, wrap half of the <li>'s in a div, and the other half in another div. Then float the divs left.

    0 讨论(0)
  • 2020-12-30 10:52

    I have just wrote a short tute on that http://www.prowebdesign.ro/wordpress-sub-menu-items-split-in-2-columns-the-easy-way/. Basically, it expands the answer of Michael Jasper, but offers a tad more flexibility: you can have 2 columns for selected sub-menus only.

    0 讨论(0)
  • 2020-12-30 10:53

    2018 edit

    Hey, 7 years later the columns css property is well supported

    ul{
      columns: 2;
    }
    <ul>
      <li>first item</li>
      <li>second item</li>
      <li>third item</li>
      <li>fourth item</li>
      <li>fifth item</li>
    </ul>

    You could probably get a similar effect with the very robust grid


    2011 original answer

    Make the ul twice as wide as the li's and float the li's left

    http://www.behemothdan.com/2011/05/faux-mega-menu-in-wordpress/

    0 讨论(0)
提交回复
热议问题