700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > html 背景色线性渐变 各种浏览器设置背景颜色线性渐变的方式

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

时间:2019-07-08 11:37:41

相关推荐

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

/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%);

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

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。