zoukankan      html  css  js  c++  java
  • 0064 2D转换综合写法以及顺序问题:translate rotate scale

    2D 转换综合写法以及顺序问题
    1. 知识要点

      • 同时使用多个转换,其格式为 transform: translate() rotate() scale()
      • 顺序会影响到转换的效果(先旋转会改变坐标轴方向)
      • 但我们同时有位置或者其他属性的时候,要将位移放到最前面
    2. 代码演示

      div:hover {
        transform: translate(200px, 0) rotate(360deg) scale(1.2)
      }
      
    <!DOCTYPE html>
    <html lang="en">
    
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>Document</title>
        <style>
            div {
                 200px;
                height: 200px;
                background-color: pink;
                transition: all .5s;
            }
            
            div:hover {
                /* transform: rotate(180deg) translate(150px, 50px); */
                /* 我们同时有位移和其他属性,我们需要把位移放到最前面 */
                transform: translate(150px, 50px) rotate(180deg) scale(1.2);
            }
        </style>
    </head>
    
    <body>
        <div></div>
    </body>
    
    </html>
    
  • 相关阅读:
    使用SpringAOP
    Alpha 冲刺 (5/10)
    Alpha 冲刺 (4/10)
    Alpha 冲刺 (3/10)
    Alpha 冲刺 (2/10)
    Alpha 冲刺 (1/10)
    项目需求分析答辩总结
    项目UML设计(团队)
    项目选题报告答辩总结
    第七次作业--项目需求分析
  • 原文地址:https://www.cnblogs.com/jianjie/p/12127179.html
Copyright © 2011-2022 走看看