代码演示: 美化小记之CSS动态渐变色背景样式 -- KIENG博客

« 美化小记之CSS动态渐变色背景样式 var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?f84e07df8353f7596cb357b2195828a7"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })();
Document div{ background: linear-gradient(90deg, #000000, #2F4F4F, #36648B, #009ACD,#7D26CD,#CD661D,#8B5A00,#5E5E5E); background-size:1000% 100%; animation:mymove 20s ease infinite; -webkit-animation: mymove 20s ease infinite; -moz-animation: mymove 20s ease infinite; } @keyframes mymove{ 0% {background-position: 0% 0%; } 20%{background-position: 0% 50%; } 40%{background-position: 50% 100%; } 50% {background-position: 100% 100%; } 60% {background-position: 100% 50%; } 80% {background-position: 50% 0%; } 100% {background-position: 0% 0%; } }
var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?f84e07df8353f7596cb357b2195828a7"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })();