css过渡2D变幻.docx
《css过渡2D变幻.docx》由会员分享,可在线阅读,更多相关《css过渡2D变幻.docx(25页珍藏版)》请在冰豆网上搜索。
css过渡2D变幻
1背景颜色过度
DOCTYPEhtml>
transition--
描述:
复合属性。
检索或设置对象变换时的过渡。
可以为同一元素的多个属性定义过渡效果。
语法:
transition:
[transition-property]||[transition-duration]||[transition-timing-function]||[transition-delay]
默认值:
看每个独立属性
取值:
[transition-property]:
检索或设置对象中的参与过渡的属性
[transition-duration]:
检索或设置对象过渡的持续时间
[transition-timing-function]:
检索或设置对象中过渡的动画类型
[transition-delay]:
检索或设置对象延迟过渡的时间
-->
body{
background-color:
deepskyblue;
}
h1{
font-size:
16px;
}
.test{
overflow:
hidden;
width:
100%;
margin:
0;
padding:
0;
list-style:
none;
}
.testli{
float:
left;
width:
100px;
height:
100px;
margin:
05px;
border:
1pxsolid#ddd;
background-color:
#eee;
text-align:
center;
-moz-transition:
background-color.5sease-in;
-webkit-transition:
background-color.5sease-in;
-o-transition:
background-color.5sease-in;
-ms-transition:
background-color.5sease-in;
transition:
background-color.5sease-in;
}
.testli:
nth-child
(1):
hover{
background-color:
#bbb;
}
.testli:
nth-child
(2):
hover{
background-color:
#999;
}
.testli:
nth-child(3):
hover{
background-color:
#630;
}
.testli:
nth-child(4):
hover{
background-color:
#090;
}
.testli:
nth-child(5):
hover{
background-color:
#f00;
}
请将鼠标移动到下面的矩形上:
背景色过渡背景色过渡背景色过渡背景色过渡背景色过渡