<cite id="ft77x"><strike id="ft77x"><listing id="ft77x"></listing></strike></cite><menuitem id="ft77x"></menuitem>
<var id="ft77x"></var><ins id="ft77x"><span id="ft77x"></span></ins>
<ins id="ft77x"><th id="ft77x"></th></ins>
<var id="ft77x"><dl id="ft77x"></dl></var>
<var id="ft77x"></var>
<cite id="ft77x"><strike id="ft77x"><listing id="ft77x"></listing></strike></cite>
<var id="ft77x"><strike id="ft77x"><listing id="ft77x"></listing></strike></var>
<var id="ft77x"></var>
<var id="ft77x"></var>
<cite id="ft77x"></cite>

DropShadow屬性在CSS濾鏡中起到的作用是什么?

發布時間:2014-04-17 發布者: 點擊:

首頁>建站常識
DropShadow屬性在濾鏡中起到什么作用?很多人看到別人網站上哪些陰影的效果,感覺很不錯,但是自己卻不會添加,那該怎么辦呢?下面我們先來了解下DropShadow屬性的作用吧,DropShadow屬性便是為了添加對象的陰影效果。它實現的效果看上去就像使原來的對象離開頁面,然后在頁面上顯示出該對象的投影。
讓我們來看一看它的表達式:
  Filter:DropShadow(Color=color,Offx=Offx,Offy=offy,Positive=positive)
  該屬性一共有四個參數:
Color代表投射陰影的顏色。
Offx和offy分別X方向和Y方向陰影的偏移量。偏移量必須用整數值來設置。如果設置為正整數,代表X軸的右方向和Y軸的向下方向。設置為負整數則相反。
  Positive參數有兩個值:True為任何非透明像素建立可見的投影,False為透明的像素部分建立可見的投影。
  同樣,我們先來看一個例子(見下圖):
c2876df7tx6BnForAKBa1&690.jpg
如圖中的文字就像是從頁面上飛出來一樣,并且留下了一層淡淡的影子,實際上在這里應用的就是CSS的DropShadow屬性,我們來看一下它的代碼:
  
    <html>
   <head>
   <title>dropshadow </title>
   <style>//
   <!--
   div {position:absolute;top:20;width:300;
   filter:dropshadow(color=#FFCCFF,offx=15,offy=10,positive=1);}
    -->
   //
   </style>
   </head>
   <body>
   <div>
   <p style="font-family:matisse itc;font-size:64;
        font-weight:bold;color:#CC00CC;">
   //
   Love Leaf </p>
   </div>
   </body>
   </html>
  和chroma屬性一樣,Dropshadow屬性對圖象的支持不好,我指的是JPEG、GIF格式的圖象文件。
  不能支持的原因與Chroma一樣,因為這種圖象的顏色很豐富,很難找到一個投射陰影的位置。