Flex布局,具有等分布局的能力,如图

<html>
<head>
    <title></title>
    <style type="text/css">
        *{
            margin: 0;padding: 0;
        }
        ul{
            display: flex;
            flex-wrap: wrap;
            justify-content: flex-start;
            width: 1000px;
            margin: 0 auto;
            list-style-type: none;
            border: 1px solid red;
        }
        li{
            width: 30%;
            background-color: #eee;
            margin: 10px auto;
            height: 40px;
        }
    </style>
</head>
<body>
    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
        <li>5</li>
    </ul>
</body>
</html>

 

posted @ 2017-09-29 14:57  吾生有涯,而知无涯!  阅读(892)  评论(0编辑  收藏  举报