CSS3 transform.html

13698 단어
/span>html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>title>
    <style type="text/css">
        body, div {
            margin:0;
            padding:0;
        }
        div {
            width: 100px;
            height: 100px;
            background-color: burlywood;
            margin-left: 50px;
            border: 1px solid red;
            display: inline-block;/*   ,      width height*/
        }
        /*
            translate(tx, ty)
                 html      tx  ,    ty  。  ty    ,   0。
            translate(tx) -> translateX(tx)
            translate(ty) -> translateY(ty)
        */
        .translate-original {}
        .translate-now {
            -webkit-transform: translate(10px, 10px);
        }
        /*
            rotate(angle)   deg
                 html       angle  
        */
        .rotate-now {
            -webkit-transform: rotate(30deg);
        }
        /*
            scale(sx, sy);
                   HTML         sx,      sy,        ,sy  ,   1。
                  scale(sx)      scaleX(sx)
            scale(sy)     scaleY(sy)
        */
        .scale-now {
            -webkit-transform: scale(1.5, 0.5);
        }
        .scale-now2 {
            -webkit-transform: scale(0.5, 1.5);
        }
        /*
            skew(sx, sy)
                 html    x   sx  ,  y   sy  
            skewX(sx) skewY(sy)
        */
        .skew-now {
            -webkit-transform: skew(45deg, 0deg);
        }
        .skew-now2 {
            -webkit-transform: skewY(45deg);
        }
        /*  */
        .component {
            -webkit-transform: skewY(45deg) scale(1.5, 0.5);
        }
        /*     */
        .center {
            -webkit-transform: skewY(45deg);
            -webkit-transform-origin: left top;
        }
    style>
head>
<body>
    <div>  div>
        
    <div>  div>
    <hr/>
    <div>  div>
      10px 10px
    <div class="translate-now">  div>
    <hr/>
    <div>  div>
      30 
    <div class="rotate-now">  div>
    <hr/>
    <div>  div>
      1.5, 0.5
    <div class="scale-now">  div>
    <hr/>
    <div>  div>
      0.5, 1.5
    <div class="scale-now2">  div>
    <hr/>
    <div>  div>
    x   45 
    <div class="skew-now">  div>
    <hr/>
    <div>  div>
    y   45 
    <div class="skew-now2">  div>
    <hr/>
    <div>  div>
    y   45      1.5,0.5
    <div class="component">  div>
    <hr style="margin-top: 50px"/>
    <div>  div>
    y   45     left top
    <div class="center">  div>
body>
html>

좋은 웹페이지 즐겨찾기