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效果,欢迎交流。

  • 相关阅读:
    [转] torch损失函数
    [转] EM算法
    [转] 先验概率and后验概率
    [转] 协方差矩阵
    系统安全管理
    deeplearing4j学习以及踩过的坑
    ES 应用
    springboot使用多数据源以及配置
    SparkStreaming+Kafa+HBase
    使用IDEA2017在Windows下编程并测试Hadoop2.7+Spark2.2+Azkaban
  • 原文地址:https://www.cnblogs.com/suiucat/p/9866793.html
Copyright © 2011-2022 走看看