Css动画(360度旋转、旋转放大、放大、浮动)
2017-07-06 15:12
435 查看
<!DOCTY
ae56
PE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style type="text/css">
div{
width:120px;
height:120px;
line-height:120px;
margin: 20px;
background-color: #5cb85c;
float: left;
font-size: 12px;
text-align: center;
color:orangered;
}
transition: All 0.4s ease-in-out;
-webkit-transition: All 0.4s ease-in-out;
-moz-transition: All 0.4s ease-in-out;
-o-transition: All 0.4s ease-in-out;
}
.img1:hover {
transform: rotate(360deg);
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-o-transform: rotate(360deg);
-ms-transform: rotate(360deg);
}
transition: All 0.4s ease-in-out;
-webkit-transition: All 0.4s ease-in-out;
-moz-transition: All 0.4s ease-in-out;
-o-transition: All 0.4s ease-in-out;
}
.img2:hover {
transform: scale(1.2);
-webkit-transform: scale(1.2);
-moz-transform: scale(1.2);
-o-transform: scale(1.2);
-ms-transform: scale(1.2);
}
transition: All 0.4s ease-in-out;
-webkit-transition: All 0.4s ease-in-out;
-moz-transition: All 0.4s ease-in-out;
-o-transition: All 0.4s ease-in-out;
}
.img3:hover {
transform: rotate(360deg) scale(1.2);
-webkit-transform: rotate(360deg) scale(1.2);
-moz-transform: rotate(360deg) scale(1.2);
-o-transform: rotate(360deg) scale(1.2);
-ms-transform: rotate(360deg) scale(1.2);
}
transition: All 0.4s ease-in-out;
-webkit-transition: All 0.4s ease-in-out;
-moz-transition: All 0.4s ease-in-out;
-o-transition: All 0.4s ease-in-out;
}
.img4:hover {
transform: translate(0, -10px);
-webkit-transform: translate(0, -10px);
-moz-transform: translate(0, -10px);
-o-transform: translate(0, -10px);
-ms-transform: translate(0, -10px);
}
</style>
</head>
<body>
<div class="img1">效果一:360°旋转 </div>
<div class="img2">效果二:放大</div>
<div class="img3">效果三:旋转放大</div>
<div class="img4">效果四:上下移动 </div>
</body>
</html>
ae56
PE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style type="text/css">
div{
width:120px;
height:120px;
line-height:120px;
margin: 20px;
background-color: #5cb85c;
float: left;
font-size: 12px;
text-align: center;
color:orangered;
}
/*效果一:360°旋转 修改rotate(旋转度数)*/
.img1 {transition: All 0.4s ease-in-out;
-webkit-transition: All 0.4s ease-in-out;
-moz-transition: All 0.4s ease-in-out;
-o-transition: All 0.4s ease-in-out;
}
.img1:hover {
transform: rotate(360deg);
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-o-transform: rotate(360deg);
-ms-transform: rotate(360deg);
}
/*效果二:放大 修改scale(放大的值)*/
.img2 {transition: All 0.4s ease-in-out;
-webkit-transition: All 0.4s ease-in-out;
-moz-transition: All 0.4s ease-in-out;
-o-transition: All 0.4s ease-in-out;
}
.img2:hover {
transform: scale(1.2);
-webkit-transform: scale(1.2);
-moz-transform: scale(1.2);
-o-transform: scale(1.2);
-ms-transform: scale(1.2);
}
/*效果三:旋转放大 修改rotate(旋转度数) scale(放大值)*/
.img3 {transition: All 0.4s ease-in-out;
-webkit-transition: All 0.4s ease-in-out;
-moz-transition: All 0.4s ease-in-out;
-o-transition: All 0.4s ease-in-out;
}
.img3:hover {
transform: rotate(360deg) scale(1.2);
-webkit-transform: rotate(360deg) scale(1.2);
-moz-transform: rotate(360deg) scale(1.2);
-o-transform: rotate(360deg) scale(1.2);
-ms-transform: rotate(360deg) scale(1.2);
}
/*效果四:上下左右移动 修改translate(x轴,y轴)*/
.img4 {transition: All 0.4s ease-in-out;
-webkit-transition: All 0.4s ease-in-out;
-moz-transition: All 0.4s ease-in-out;
-o-transition: All 0.4s ease-in-out;
}
.img4:hover {
transform: translate(0, -10px);
-webkit-transform: translate(0, -10px);
-moz-transform: translate(0, -10px);
-o-transform: translate(0, -10px);
-ms-transform: translate(0, -10px);
}
</style>
</head>
<body>
<div class="img1">效果一:360°旋转 </div>
<div class="img2">效果二:放大</div>
<div class="img3">效果三:旋转放大</div>
<div class="img4">效果四:上下移动 </div>
</body>
</html>
相关文章推荐
- CSS3动画(360度旋转、旋转放大、放大、移动)
- CSS3动画(360度旋转、旋转放大、放大、移动)
- CSS3动画(360度旋转、旋转放大、放大、移动)
- [转载]CSS3动画(360度旋转、旋转放大、放大、移动)
- CSS3动画(360度旋转、旋转放大、放大、移动)(转)
- CSS3动画(360度旋转、旋转放大、放大、移动)
- iOS开发动画(Animation)图片360度不停旋转
- 圆形图片360度不停旋转---@-webkit-keyframes使用@keyframes规则,你可以创建动画
- iOS开发动画(Animation)图片360度不停旋转
- CSS 实现加载动画之四-圆点旋转
- CSS 实现加载动画之五-光盘旋转
- CSS 实现加载动画之七-彩环旋转
- 前端的小玩意(8)——旋转的盒子(纯CSS动画效果)+可自由拖动(js)
- Android动画——放大、缩小、旋转、平移、组合
- 一个CSS+jQuery实现的放大缩小动画效果
- iOS开发动画(Animation)图片360度不停旋转
- iOS开发动画(Animation)图片360度不停旋转
- 【转载】CSS3 常用四个动画(旋转、放大、旋转放大、移动)
- 360度不停旋转动画
- 放大、缩小、旋转、开始动画