search

Home  >  Q&A  >  body text

css - Flexbox 怎么实现多行多列

RT,

  1. ul中有若干li 一行两个li 两个li 自动适应 ul宽度

  2. li多列

如何用Flexbox实现。

PHPzPHPz2786 days ago596

reply all(2)I'll reply

  • 黄舟

    黄舟2017-04-17 11:08:37

    <ul class="flexcontainer">
        <li>Something</li>
        <li>Fox Example</li>
        <li>All About Web</li>
        <li>Fox Example</li>
        <li>Something</li>
        <li>Fox Example</li>
        <li>Something</li>
        <li>Fox Example</li>
    </ul>
    
    .flexcontainer {
        width: 300px;
        display: flex;
        flex-flow: row wrap;
    }
    .flexcontainer li {
        width: 50%;
        background-color: pink;
    }
    

    http://jsfiddle.net/bdm5d8p4/

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 11:08:37

    For more information about flexbox, please refer to this article: http://segmentfault.com/a/1190000002910324.

    reply
    0
  • Cancelreply