Bri*_*rij 6 html javascript css cross-browser opacity
如何实现跨浏览器不透明度渐变(不是颜色渐变)?请参阅以下代码:
<div style="background-color:Red;display:block;height:500px;width:500px;filter:alpha(Opacity=100, FinishOpacity=0, Style=1, StartX=0, StartY=0, FinishX=0, FinishY=500)"></div>
Run Code Online (Sandbox Code Playgroud)
它在IE中运行良好,但在其他浏览器中没有,如firefox,safari ..等.什么是firefox的等效语法?请不要建议我使用渐变图像.
谢谢@deceze,
我正在为具有相同要求的其他人编写示例css
top:0px;
opacity: 0.6;
width: 1944px;
height: 896px;
position: absolute;
z-index: 500;
background-color:#dcdcdc;
/* For WebKit (Safari, Google Chrome etc) */
background: -webkit-gradient(linear, left top, left bottom, from(#dcdcdc), to(rgba(215,212,207,0)));
/* For Mozilla/Gecko (Firefox etc) */
background: -moz-linear-gradient(top, #dcdcdc, rgba(215,212,207,0));
/* For Internet Explorer 5.5 - 7 */
filter:alpha(Opacity=70, FinishOpacity=0, Style=1, StartX=1242, StartY=0, FinishX=1242, FinishY=696);
/* For Internet Explorer 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70, FinishOpacity=0, Style=1, StartX=1242, StartY=0, FinishX=1242, FinishY=696)";
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5683 次 |
| 最近记录: |