zoukankan      html  css  js  c++  java
  • ie中的居中缩放

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <style>
            .box {
                /* 可见视觉区域 */
                 480px; height: 250px;
                position: relative;
                overflow: hidden;
                cursor: pointer;
            }
            .size {
                /* 广阔的海洋 */
                 1000px; height: 1000px;
                position: absolute; left: 50%; top: 50%;
                margin: -500px 0 0 -500px;
                /* 水平居中 */
                text-align: center;
            }
            .zoom {
                /* 缩放的元素 */
                 480px; height: 250px;
                vertical-align: middle;
                -webkit-transition: -webkit-transform .2s;
                transition: transform .2s;
            }
            .box:hover .zoom {
                /* hover放大 */
                -webkit-transform: scale(1.05);
                -ms-transform: scale(1.05);
                transform: scale(1.05);
                zoom: 1.05;
            }
            :root .box:hover .zoom {
                zoom: 1;
            }
            .middle {
                /* 垂直居中 */
                display: inline-block;
                 0; height: 100%;
                vertical-align: middle;
            }
        </style>
    </head>
    <body>
        <h4>左上角定位</h4>
        <div class="box">
            <img src="timg.jpg" class="zoom">
        </div>
        <h4>居中定位</h4>
        <div class="box">
            <div class="size">
                <img src="timg.jpg" class="zoom"><i class="middle"></i>
            </div>
        </div>
    </body>
    </html>
    

      

    author:Lik
    Endeavoring to powerless, struggling to move yourself.
  • 相关阅读:
    apache虚拟主机三种不同配置方式
    搭建http服务器及配置
    学校ftp服务器搭建
    vsftpd搭建使用
    nginx使用
    pxe+kickafkstart (二)转
    pxe批量网络装机
    bash中()使用特性
    ansible使用
    javascript 之 Object.defineProperty
  • 原文地址:https://www.cnblogs.com/likwin/p/7519804.html
Copyright © 2011-2022 走看看