zoukankan      html  css  js  c++  java
  • CSS小小层叠特效

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8"/>
        <title>层叠</title>
        <style>
         body {
             margin: 0;
             padding: 0;
              100%;
             height: 100vh;
             display: flex;
             align-items: center;
             justify-content: center;
         }
         .container {
             position: relative;
              360px;
             height: 640px;
             margin-top: 150px;
             background: rgba(0, 0, 0, 1);
             transform: rotate(-10deg) skew(30deg) scale(.8);
             transition: 0.5s;
         }
         .container img {
              100%;
             height: 100%;
             position: absolute;
             transition: 0.5s;
         }
         .container:hover img:nth-child(4){
             transform: translate(80px, -80px);
             opacity: 1;
         }
         .container:hover img:nth-child(3){
             transform: translate(60px, -60px);
             opacity: .8;
         }
         .container:hover img:nth-child(2){
             transform: translate(40px, -40px);
             opacity: .6;
         }
         .container:hover img:nth-child(1){
             transform: translate(20px, -20px);
             opacity: .4;
         }
        </style>
    </head>
    <body>
        <div class="container">
            <img src="./tx.jpg" alt="">
            <img src="./tx.jpg" alt="">
            <img src="./tx.jpg" alt="">
            <img src="./tx.jpg" alt="">
        </div>   
    </body>
    </html>
    

     效果如下:

      

    怎么样?炫酷吧。

    ps:图片上的人物是优雅汉尼拔·莱克特医生

    如果你有什么更有意思的CSS效果,欢迎交流。

  • 相关阅读:
    阅读13-17章
    阅读<构建之法>10、11、12章
    作业5.2
    作业5.1
    作业四:构建之法的困惑和思考(5-7)
    做汉堡
    作业三:构建之法的困惑和思考(1-5)
    实验二 合作:王宏财 http://www.cnblogs.com/wanghongcai/
    实验一--四则运算
    数独九宫格
  • 原文地址:https://www.cnblogs.com/suiucat/p/9866793.html
Copyright © 2011-2022 走看看