1.過渡動(dòng)畫
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>過渡動(dòng)畫</title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
.box{
width: 300px;
height: 500px;
background-color: #135;
margin: 50px auto;
}
.box:hover{
width: 500px;
height: 300px;
margin: 50px auto;
background-color: #909090;
}
</style>
</head>
<body>
<div class="box">
<input type="text" name="輸入" id="dasd">
</div>
</body>
</html>
2.動(dòng)畫
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>動(dòng)圖</title>
<style type="text/css">
*{
margin:0;
padding:0;
}
.box{
width: 500px;
height: 200px;
border: 1px solid black;
margin: 100px auto;
}
.box1{
width: 40px;
height: 80px;
background:red;
float: left;
margin:50px 0 0 50px;
border-radius: 10px;
animation: moving 500ms ease 0ms infinite alternate both;
}
.box2{
width: 40px;
height: 80px;
background: purple;
float: left;
margin:50px 0 0 50px;
/*margin-top: 50px;
margin-left: 50px;*/
border-radius: 10px;
animation: moving 500ms ease 100ms infinite alternate both;
}
.box3{
width: 40px;
height: 80px;
background: green;
float: left;
margin:50px 0 0 50px;
/*margin-top: 50px;
margin-left: 50px;*/
border-radius: 10px;
animation: moving 500ms ease 200ms infinite alternate both;
}
.box4{
width: 40px;
height: 80px;
background: yellow;
float: left;
margin:50px 0 0 50px;
/*margin-top: 50px;
margin-left: 50px;*/
border-radius: 10px;
animation: moving 500ms ease 300ms infinite alternate both;
}
.box5{
width: 40px;
height: 80px;
background: pink;
float: left;
margin:50px 0 0 50px;
/*margin-top: 50px;
margin-left: 50px;*/
border-radius: 10px;
animation: moving 500ms ease 400ms infinite alternate both;
}
@keyframes moving{
from{
transform: scaleY(1);
}
to{
transform: scaleY(0.5);
}
}
.box6{
width: 100px;
height: 21px;
background-color: #FFFFFF;
float: left;
margin:10px 0 0 200px;
}
</style>
</head>
<body>
<div class="box">
<div class="box1"></div>
<div class="box2"></div>
<div class="box3"></div>
<div class="box4"></div>
<div class="box5"></div>
<div class="box6"><p>loading...</p></div>
</div>
</body>
</html>
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者