html 背景色线性渐变,各种浏览器设置背景颜色线性渐变的方式

http://www.cnblogs.com/acaciasun/p/3300554.html

1、Firefox

background:-moz-linear-gradient(top, red, red 50%,red,yellow 50%,yellow,yellow);

2、Chrome、Safari

background:-webkit-gradient(linear, left top, left bottom, color-stop(0.50, #ff0), color-stop(0.50, rgb(255, 0, 0)));

3、IE

filter:alpha(opacity=100 finishopacity=0 style=1 startx=0,starty=50,finishx=0,finishy=70) progid:DXImageTransform.Microsoft.gradient(startcolorstr=red,endcolorstr=blue,gradientType=0);

-ms-filter:alpha(opacity=100 finishopacity=50 style=1 startx=0,starty=0,finishx=0,finishy=150) progid:DXImageTransform.Microsoft.gradient(startcolorstr=red,endcolorstr=blue,gradientType=0);/*IE8*/

说明:startx,finishx等用的是百分比,但是不能带%(IE就是矫情)

4、Opera

background:-o-linear-gradient(top,red 20%,yellow 50%,green 80%);

说明:具体怎么用不太清楚,这里有介绍:http://dev.opera.com/articles/view/css3-linear-gradients/

转载于:https://www.cnblogs.com/acaciasun/p/3300554.html

标签:浏览器,linear,gradient,渐变,yellow,finishx,线性,top,red

来源: https://blog.csdn.net/weixin_30559481/article/details/97546571

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值