SOURCE

console 命令行工具 X clear

                    
>
console
        <ul class="pic_list">
            <li><div><span>1</span></div></li>                    
            <li><div><span>2</span></div></li>                    
            <li><div><span>3</span></div></li>                    
            <li><div><span>4</span></div></li>                    
            <li><div><span>5</span></div></li>                    
            <li><div><span>6</span></div></li>                    
            <li><div><span>7</span></div></li>                    
            <li><div><span>8</span></div></li>                    
            <li><div><span>9</span></div></li>                    
        </ul> 
<ul class="figure-list">
<li>
<figure style="background-image:url(IMG_20180329_100650.jpg)"></figure>
</li>
<li>
<figure style="background-image:url(IMG_20180329_100700.jpg)"></figure>
</li>
<li>
<figure style="background-image:url(QQ%E5%9B%BE%E7%89%8720170224104232.jpg)"></figure>
</li>
<li>
<figure style="background-image:url(img/9.jpg)"></figure>
</li>
</ul>
            a, body, center, cite, code, dd, del, div, dl, dt, em, fieldset, figcaption, figure, footer, form, h1, h2, h3, h4, h5, h6, header, hr, html, img, input, label, legend, li, mark, ol, p, section, span, strong, textarea, time, ul, var input{
                margin: 0;
                border: 0;
                padding: 0;
                font-style: normal;
                color: #323232;
                box-sizing: border-box;
                -moz-box-sizing:border-box; /* Firefox */
                -webkit-box-sizing:border-box; /* Safari */
            }
            html,body{
                background: #fff;
            }
            ul{
                text-decoration: none;
                list-style-type: none;
            }
            .pic_list>li{
                float: left;
                width: 32%;
                text-align: center;
                border: 1px solid #ccc;
                padding-top: 31%;
                margin-left: 1%;
                margin-top: 1%;
                position: relative;
            }
            .pic_list>li>div{
                position: absolute;
                left: 0;
                top: 0;
                width: 100%;
                height: 100%;
                background-color: #09BE07;
            }
            .pic_list>li>div>span{
                display: inline-block;
                margin-top: 50%;
                -webkit-transform: translateY(-50%);
                transform: translateY(-50%);
            }

.figure-list{
margin-top: 10px;
}
.figure-list li{
list-style: none;
float: left;
width: 31%;
margin: 0 2% 2% 0;
}
.figure-list figure{
position: relative;
width: 100%;
height: 0;
overflow: hidden;
margin: 0;
padding-bottom: 100%; /* 关键就在这里 */
background-position: center;
background-repeat: no-repeat;
background-size: cover;

}