zoukankan      html  css  js  c++  java
  • 使用纯CSS制作展开合并立方体特效

    显示效果
    这里写图片描述

    源码

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>css动画练习</title>
    </head>
    <style>
    body {
        background: #999;
        margin: 0 auto;
        font-size: 100px;
        height: 100%;
    }
    
    div {
        margin: 0 auto;
        position: absolute;
        left: 50%;
        top: 50%;
        width: 100px;
        height: 100px;
    }
    
    div.a {
        background: red;
        transition: width 2s, height 2s, transform 2s;
    }
    
    div.b {
        background: yellow;
        transition: width 2s, height 2s, transform 2s;
    }
    
    div.c {
        background: blue;
        transition: width 2s, height 2s, transform 2s;
    }
    
    div.d {
        background: pink;
        transition: width 2s, height 2s, transform 2s;
    }
    
    div.e {
        background: white;
        transition: width 2s, height 2s, transform 2s;
    }
    
    div.f {
        background: purple;
        transition: width 2s, height 2s, transform 2s;
    }
    
    body:hover div.a {
        width: 200px;
        height: 200px;
        transform: rotatex(260deg) rotate(90deg) translate(1100px, 0);
    }
    
    body:hover div.b {
        width: 200px;
        height: 200px;
        transform: rotatex(-180deg) rotate(90deg) translate(300px, 0);
    }
    
    body:hover div.c {
        width: 200px;
        height: 200px;
        transform: rotatey(-80deg) rotate(-90deg) translate(300px, -600px);
    }
    
    body:hover div.d {
        width: 200px;
        height: 200px;
        transform: rotatey(80deg) rotate(90deg) translate(-300px, -600px);
    }
    
    body:hover div.e {
        width: 200px;
        height: 200px;
        transform: rotatex(80deg) rotate(90deg) translate(-2300px, 0);
    }
    
    body:hover div.f {
        width: 200px;
        height: 200px;
        transform: rotatex(360deg) rotate(90deg) translate(-300px, 0);
    }
    </style>
    <body >
        <div class="a">A</div>
        <div class="b">B</div>
        <div class="c">C</div>
        <div class="d">D</div>
        <div class="e">E</div>
        <div class="f">F</div>
    </body>
  • 相关阅读:
    python的metaclass
    鱼和水的故事
    iOS的QuickTime Plugin
    二进制/十六进制转浮点数的编程(互转类似)
    Android开发常见错误及技巧
    Mac 热键大全
    Java动态程序设计:反射介绍
    注册asp.net 4.0 到iis
    javascript常用判断写法
    将存储过程执行的结果保存到临时表
  • 原文地址:https://www.cnblogs.com/YooHoeh/p/9095398.html
Copyright © 2011-2022 走看看