CSS使用过渡
加在hover内:
transition:
1. delay:延迟
2. duration:动画渐变
3. property:属性名(只渐变这一个属性)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CreateTrans</title>
<style type="text/css">
p {
width: 100px;
height: 100px;
background-color: antiquewhite;
}
p:hover{
width:200px;
height:200px;
background-color: #ffad2a;
transition-delay: 1s;
transition-duration: 1s;
transition-property: background-color
/*-webkit-transition-duration: ; -moz-transition-duration: ;*/
}
</style>
</head>
<body>
<p></p>
</body>
</html>