DIV CSS 佈局教程網

您现在的位置: DIV+CSS佈局教程網 >> 網頁腳本 >  >> CSS入門知識 >> CSS詳解
DIV 樣式的特殊效果(4):glow、mask、shadow 與漸層濾鏡
編輯:CSS詳解     

延續濾鏡效果的整理,本頁示範光暈、遮罩、陰影、X 光、漸層、像素化與透明度等寫法。以下效果多屬 IE 專屬的 filter 語法。

glow(光暈)

<div style="filter:glow(color='#0000ff', strength='3');
     width:100px; height:100px;">
<br/>
strength:光的強度,0–100;此時不能設 DIV 背景色。
</div>

mask(遮罩)

<div style="filter:mask(color='#ff0000'); width:100px; height:100px;
     text-transform:uppercase; color:black;">
<br/>
沒有明顯效果,不能設背景色。
</div>

shadow(陰影)

<div style="filter:shadow(color='#0000ff', direction='100');
     width:100px; height:100px;">
<br/>
abcdefghijklmn
</div>

Xray(輪廓線)

<div style="filter:Xray; width:100px; height:100px; background-color:red;">
<br/>
sfasdfasdfasdfsadf
</div>

Gradient(漸層)

<div style="filter:progid:DXImageTransform.Microsoft.Gradient(
       GradientType=100, StartColorStr='#B5CCFA', EndColorStr='#ffffff');
     width:100px; height:100px;">
漸變效果。
<br/>
endendendendend
</div>

Pixelate(像素化)

<div style="filter:progid:DXImageTransform.Microsoft.Pixelate(maxsquare=5);
     width:100px; height:100px;">
lsksalsslalalalalalalal
</div>

Alpha(透明度漸變)

<div style="filter:alpha(opacity=100, finishOpacity=0, style=2);
     width:100px; height:100px; background-color:yellow;">
</div>

提醒:這些 filter 語法為 IE 特有,其他瀏覽器不會理會;跨瀏覽器實作相同視覺時,請改用 CSS3 的 box-shadow、linear-gradient、opacity 等標準屬性。

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved