如果只要求兼容高级浏览器,CSS3可以解决。
.box{width:500px;height:100px;background-image: -moz-linear-gradient(top , #45B5DA, #0382AD);background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, from(#45B5DA), to(#0382AD));background-image: -o-linear-gradient(top , #45B5DA, #0382AD);}如果要兼容低级浏览器,例如凯答瞎IE6,还是用背景图片重复吧。举数
上面的这属性可以盯空在CSS手册里查到。
background: #000000;
background: -moz-linear-gradient(top, #000000 0%, #ffffff 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#000000), color-stop(100%,#ffffff));
background: -webkit-linear-gradient(top, #000000 0%,#ffffff 100%);
background: -o-linear-gradient(top, #000000 0%,#ffffff 100%);
background: -ms-linear-gradient(top, #000000 0%,#ffffff 100%);
background: linear-gradient(to bottom, #000000 0%,#ffffff 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#000000'橡知, endColorstr='缺燃#ffffff',GradientType=0 );
使用css3可以做。伏如虚
以上就是土嘎嘎小编大虾米为大家整理的css3背景颜色渐变属性_css背景图片渐变色怎么设置相关主题介绍,如果您觉得小编更新的文章对您有所帮助,不要忘记讲本站分享给您身边的朋友哦!!