网站建设利用css背景渐变来做动画,很多动画效果有个不好的地方就是体积很大,很影响网页的打开速度,渲染程度比较高,很慢,这个动画效果就很轻巧,很好用;网站建设极力推荐。
gradient background animation?动画效果原地址html代码
<h1>pure css3 animated gradient background</h1>
css代码
body {
width: 100wh;
height: 90vh;
color: #fff;
background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
background-size: 400% 400%;
-webkit-animation: gradient 15s ease infinite;
-moz-animation: gradient 15s ease infinite;
animation: gradient 15s ease infinite;
}
@-webkit-keyframes gradient {
0% {
background-position: 0% 50%
}
50% {
background-position: 100% 50%
}
100% {
background-position: 0% 50%
}
}
@-moz-keyframes gradient {
0% {
background-position: 0% 50%
}
50% {
background-position: 100% 50%
}
100% {
background-position: 0% 50%
}
}
@keyframes gradient {
0% {
background-position: 0% 50%
}
50% {
background-position: 100% 50%
}
100% {
background-position: 0% 50%
}
}
h1,
h6 {
font-family: 'open sans';
font-weight: 300;
text-align: center;
position: absolute;
top: 45%;
right: 0;
left: 0;
}