css3 动画

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" type="text/css" href="css/style.css">
  <style>
    /*平移动画*/
.box_1{width: 100px;
        height: 100px;
        background-color: #ccc;
        transition:all 0.35s;
}
.box_1:hover{transform:translate(50px,0px);}

/*旋转动画*/
.box_2{ width: 100px;
        height: 100px;
        margin-top: 50px;
        background-color: #ccc;
        transition:all 0.35s;
        transform:rotate(0deg);
}
.box_2:hover{transform:rotate(45deg);}

/*缩放动画*/
.box_3{width: 100px;
        height: 100px;
        background-color: #ccc;
        margin-top: 50px;
        transition:all 0.35s;
}
.box_3:hover{transform:scale(1.5,1.5);}

/*斜切动画*/
.box_4{width: 100px;
        height: 100px;
        background-color: #ccc;
        margin-top: 50px;
        transition:all 0.35s;
}
.box_4:hover{transform:skew(45deg);}
  </style>
</head> <body> <div class="box_1">平移动画</div> <div class="box_2">旋转动画</div> <div class="box_3">缩放动画</div> <div class="box_4">斜切动画</div> </body> </html>

 

posted @ 2016-05-09 17:30  少爷zwx  阅读(105)  评论(0)    收藏  举报