How to wrap a div vertically and then horizontally

后端 未结 4 2051
误落风尘
误落风尘 2021-01-11 13:20

I need to show the search result data in my site horizontally. I follow a metro UI approach for my website, so I want the data to flow horizontally instead of vertically.

4条回答
  •  失恋的感觉
    2021-01-11 13:50

    Flexbox will be a JavaScript-less solution:

    #wrap1 {
        display: flex;
        flex-wrap: wrap;
        flex-direction: column;
    }
    

    Demo: http://jsfiddle.net/4wuJz/5/

提交回复
热议问题