“Alpha”滤镜,它的作用基本就是把一个目标元素与背景混合。你可以指定数值来控制混合的程度。这种“与背景混合”,通俗地说就是一个元素的透明度。通过指定坐标,可以指定点、线、面的透明度。由于“Alpha”滤镜的参数比较多,所以我们先来了解一下参数,各参数含义分别如下: 在使用“Alpha”滤镜时要注意: 1、由于“Alpha”滤镜使当前元素部分透明,该元素下层的内容的颜色对整个效果起着重要作用,因此颜色的合理搭配相当重要; 2、透明度的大小要根据具体情况仔细调整,取一个最佳值。 语法: filter: alpha(opacity=100,finishOpacity=0,style=3)或者 filter: Alpha(Opacity=10, FinishOpacity=90, Style=3, StartX=0, StartY=0, FinishX=100, FinishY=100) 代码举例: 例1:<p style="width: 400px; filter: alpha(opacity=100,finishOpacity=0,style=3);"><font style="line-height: normal; font-size: 30pt; font-style: normal; font-variant: normal; font-weight: normal; background-color: rgb(0, 0, 0);" color="#00ff00" face="华文行楷"><b>“春天没来”欢迎您</b></font></p> 效果: “春天没来”欢迎您 例2、<p style="width: 400px; filter: Alpha(Opacity=10, FinishOpacity=90, Style=3, StartX=0, StartY=0, FinishX=100, FinishY=100);;"><font style="line-height: normal; font-size: 30pt; font-style: normal; font-variant: normal; font-weight: normal; background-color: rgb(0, 0, 0);" color="#00ff00" face="华文行楷"><b>“春天没来”欢迎您</b></font></p> 效果: “春天没来”欢迎您 |
|