效果图:
代码如下:
background-image: -webkit-gradient(linear,left top, left bottom,from(rgba(255,255,255,0)),color-stop(70%, #fff));
background-image: linear-gradient(-180deg,rgba(255,255,255,0) 0%,#fff 70%);
效果图:
代码如下:
background-image: -webkit-gradient(linear,left top,right top,from(rgba(255,255,255,0)),color-stop(47%,#fff));
background-image: linear-gradient(90deg,rgba(255,255,255,0) 0,#fff 47%);
渐变代码:
.bg{ background: -webkit-linear-gradient(left, #2b97ed , #195abc); /* Safari 5.1 - 6.0 */background: -o-linear-gradient(right, #2b97ed, #195abc); /* Opera 11.1 - 12.0 */ background: -moz-linear-gradient(right, #2b97ed, #195abc); /* Firefox 3.6 - 15 */ background: linear-gradient(to right, #2b97ed , #195abc); /* 标准的语法(必须放在最后) */}
body{background: url(../images/bg.png) top center no-repeat,linear-gradient( rgba(45,140,232,0.5) , rgba(255,255,255,0));}/*先图片后渐变*/ /*body{background: linear-gradient( rgba(45,140,232,0.5) , rgba(255,255,255,0)), url(../images/bg.png) top center no-repeat;}*//*先渐变后图片*/