• div+css垂直居中


    一、显示的图片分别为小图,宽度大的图片,高度大的图片分别显示以下效果。

    <style type="text/css">   

    .example{  

    100%;    

    text-align:center;    

    margin-bottom: 30px;    

    margin-top: 20px;

    }

    .example  div{  

    500px;  

    height:400px;    

    text-align: center;    

    display: table-cell;    

    vertical-align: middle;    

    border: 1px solid rgba(0, 0, 0, 0.43); }

    .example  img{    

    max-height:400px;  

    max-500px;    

    vertical-align: middle; }

    </style>  

    <div class="example fn-clear" >

                        <center>                               

                                     <div>                                    

                                       <img style="border: 1px solid grey" src="C:UsersPublicPicturesSample Picturesw.jpg"/>                               

                                     </div>                    

                       </center>  

                    </div>

    </body>

    </html>

    二、显示一排图片的处理效果

    <style type="text/css">

    .list_con li{  float:left;  padding:25px 18px 0 0;  146px; }

    .list_con li div {  border: 1px solid  #000;     border-image: none;     146px;     height: 146px;     text-align: center;     vertical-align: middle;     display: table-cell;     line-height:143px; }

    .list_con .ph_pic img{  max-146px;  max-height:146px;     vertical-align: middle; }

    .list_con p{  padding:8px 0 5px;  text-align:center; }

    .list_con p img{  padding:0 16px;  16px;  height:16px; }

    .fn-clear:after {  visibility:hidden;  display:block;  font-size:0;  content:" ";  clear:both;  height:0; }

    .fn-clear {  zoom:1; /* for IE6 IE7 */ }

    </style>

    <div class="list_con fn-clear">
             <ul style="list-style:none">
                 <li>
                    <div>
                     <a  target="_blank" class="ph_pic"   href="#"> <img style="border: 1px solid grey" src="../../UploadFiles/123.gif"/><a>
                    </div>                 
                    </li>
                    /* 复制7个li*/
                </ul>
     </div>

    效果如下:

  • 相关阅读:
    查看gpu和cpu使用情况 linux
    Oracle通过数据文件进行 数据恢复
    LeetCodeJava题解 283. Move Zeroes
    LeetCodeJava题解 844. Backspace String Compare
    LeetCodeJava题解 27. Remove Element
    LeetCodeJava题解 367. Valid Perfect Square
    LeetCodeJava题解 26. Remove Duplicates from Sorted Array
    EasyExcel实现合并一列的多行数据
    编辑qml的工具及插件
    qml学习(Qt Quick)
  • 原文地址:https://www.cnblogs.com/angelfeeling/p/3628376.html
Copyright © 2020-2023  润新知