码迷,mamicode.com
首页 > 微信 > 详细

CSS——微信朋友圈图片样式实现方法

时间:2018-04-25 19:04:31      阅读:317      评论:0      收藏:0      [点我收藏+]

标签:doctype   oct   dpi   ref   user   set   dde   ati   col   

<!DOCTYPE html>  
<html lang="en">  
    <head>  
        <meta charset="utf-8">  
        <meta name="viewport" content="width=device-width,user-scalable=no,target-densitydpi=device-dpi" />  
        <style type="text/css">
            .figure-list{
              margin: 0;
              padding: 0;
            }
            .figure-list:after{
              content: "";
              display: block;
              clear: both;
              height: 0;
              overflow: hidden;
              visibility: hidden;
            }
            .figure-list li{
              list-style: none;
              float: left;
              width: 23.5%;
              margin: 0 2% 2% 0;
            }
            .figure-list figure{
                border: 1px solid #000;
              position: relative;
              width: 100%;
              height: 0;
              overflow: hidden;
              margin: 0;
              padding-bottom: 100%; /* 关键就在这里 */
              background-position: center;
              background-repeat: no-repeat;
              background-size: cover;
            }
            .figure-list figure a{
              display: block;
              position: absolute;
              width: 100%;
              top: 0;
              bottom: 0;
            }
</style>
<ul class="figure-list">
  <li>
    <figure style="background-image:url(1.png)">
      <a href="#"></a>
    </figure>
  </li>
  <li>
    <figure style="background-image:url(2.png)">
      <a href="#"></a>
    </figure>
  </li>
   <li>
    <figure style="background-image:url(3.png)">
      <a href="#"></a>
    </figure>
  </li>
  <li>
    <figure style="background-image:url(4.png)">
      <a href="#"></a>
    </figure>
  </li>

   <li>
    <figure style="background-image:url(5.png)">
      <a href="#"></a>
    </figure>
  </li>
  <li>
    <figure style="background-image:url(6.png)">
      <a href="#"></a>
    </figure>
  </li>
</ul>
</html>  

 

CSS——微信朋友圈图片样式实现方法

标签:doctype   oct   dpi   ref   user   set   dde   ati   col   

原文地址:https://www.cnblogs.com/zzgyq/p/8946009.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!