css3渐变 彩虹条纹

linear-gradient 常用来制作渐变,如

(色彩渣,我就随便找个颜色举例)

css代码如下

background:linear-gradient(45deg,#ff0000 0%,#ffb600 11%,#fff600 22%,#a5ff00 33%,#00a9ff 44%,#0400ff 55%,#8a00fc 66%,#ff00e9 77%,#ff0059 88%,#ff0000 100%);

如果想制作条纹,很简单啦

background:linear-gradient(45deg,#ff0000 0%,#ff0000 11%,
                                 #ffb600 11%,#ffb600 22%,
                                 #fff600 22%,#fff600 33%,
                                 #a5ff00 33%,#a5ff00 44%,
                                 #00a9ff 44%,#00a9ff 55%,
                                 #0400ff 55%,#0400ff 66%,
                                 #8a00fc 66%,#8a00fc 77%,
                                 #ff00e9 77%,#ff00e9 88%,
                                 #ff0000 88%,#ff0000 100%);  

效果

径向同理

background:radial-gradient(#ff0000 0%,#ff0000 11%,
                         #ffb600 11%,#ffb600 22%,
                         #fff600 22%,#fff600 33%,
                         #a5ff00 33%,#a5ff00 44%,
                         #00a9ff 44%,#00a9ff 55%,
                         #0400ff 55%,#0400ff 66%,
                         #8a00fc 66%,#8a00fc 77%,
                         #ff00e9 77%,#ff00e9 88%,
                         #ff0000 88%,#ff0000 100%);

\

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。