• :after伪类+content经典应用举例


    :after伪类+content 清除浮动的影响

    .box{padding:10px; background:gray;}
    .l{float:left;}
    
    <div class="box">
    	<img class="l" src="http://image/imagemm1.jpg" />
    </div>
    .fix:after{display:block; content:"clear"; height:0; clear:both; overflow:hidden; visibility:hidden;}

    :after伪类+content 让大小不固定图片垂直居中

    .pic_box{300px; height:300px; background-color:#beceeb; font-size:0; *font-size:200px; text-align:center;}
     .pic_box img{vertical-align:middle;}
     .pic_box:after{display:inline-block; 0; height:100%; content:"center"; vertical-align:middle; overflow:hidden;}
    <div class="pic_box">
        <img data-src="http://image/mm1.jpg" />
    </div>
  • 相关阅读:
    tcp socket http(复制的)
    cas php
    占用字节
    网络基础
    Mbps MB/S Mb/s
    path_info和get_full_path()的区别
    rbac权限管理
    ORM _meta
    Django SQLite3的使用
    url的分发
  • 原文地址:https://www.cnblogs.com/NatChen/p/7884124.html
Copyright © 2020-2023  润新知