zoukankan      html  css  js  c++  java
  • Div图片垂直居中的方法

    css:

    Code
    <style>
    .box 
    {
            
    /*非IE的主流浏览器识别的垂直居中的方法*/
            display
    : table-cell;
            vertical-align
    :middle;

            
    /*设置水平居中*/
            text-align
    :center;

            
    /* 针对IE的Hack */
            *display
    : block;
            *font-size
    : 175px;/*约为高度的0.873,200*0.873 约为175*/
            *font-family
    :Arial;/*防止非utf-8引起的hack失效问题,如gbk编码*/

            width
    :200px;
            height
    :200px;
            border
    : 1px solid #eee;
    }
    .box img 
    {
            
    /*设置图片垂直居中*/
            vertical-align
    :middle;
    }
    </style>

    html:

    1 <div class="box"><href="http://www.howpm.com" target="_blank"><img src="http://howpm.com/images/dz7/logo.gif" /></a></div>


  • 相关阅读:
    Binary Tree Zigzag Level Order Traversal
    Add Binary
    Subsets II
    Subsets
    Minimum Depth of Binary Tree
    node Cannot enqueue Quit after invoking quit.
    微擎快速修改数量实例(异步)
    destoon 分页
    ajax里面使用this方法
    微擎系统 微信支付 get_brand_wcpay_request:fail
  • 原文地址:https://www.cnblogs.com/zhengenru2008/p/1364454.html
Copyright © 2011-2022 走看看