?? css0503.htm
字號:
<html>
<head>
<title>洪恩在線 - CSS教程</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="/pub/css/home.css">
<link rel="stylesheet" href="/pc/homepage/homepage.css">
<meta name="keywords" content="電腦樂園,電腦,樂園,交互教程,交互,教程,教育">
</head>
<body bgcolor="white" text="black" topmargin="10" leftmargin="0" marginwidth="0" marginheight="10">
<!--頂部開始-->
<script language="Javascript" src="/pub/js/head.js"></script>
<!--頂部結束-->
<table width="760" height="20" border=0 cellspacing="0" cellpadding="0" align="center">
<tr>
<td height=20 class="p1" bgcolor="#E8E8E8" align="left"><img src="/pc/img/blank.gif" width="12" height="8"><font color="#FF9966">當前位置</font>:<a href="/default.htm" class="under">洪恩在線</a>
-> <a href="/pc/index.htm" class="under">電腦樂園</a> -> CSS教程</td>
</tr>
</table>
<table width="760" border=0 cellspacing="0" cellpadding="0" align="center">
<tr>
<td height="15"></td>
</tr>
</table>
<table width="760" cellspacing="0" border=0 cellpadding="0" align="center">
<tr>
<td width="145" valign="top" bgcolor="#E8E8E8" align="left" style="color:blue" class="p1" height="123">
<br>
<table width="145" border="0" cellspacing="0" cellpadding="0" bordercolor="#F8AC0E" height="20">
<tr bgcolor="000099" valign="middle">
<td width="115" align="center" class="p2"><b><font color="#FFFFFF">CSS教程</font></b></td>
<td height="20" bgcolor="#E8E8E8" width="13"><img src="/pc/img/title_00.gif" width="13" height="20"></td>
<td height="20" bgcolor="#E8E8E8" width="17"> </td>
</tr>
</table>
<p class="p1" style="line-height:17pt" align="left"> <font color="#CC3399">→</font>
<a href="css0101.htm">CSS快速入門</a><br>
<font color="#CC3399">→</font> <a href="css0201.htm">怎樣編寫CSS</a><br>
<font color="#CC3399">→</font> <a href="css0301.htm">CSS屬性</a><br>
<font color="#CC3399">→</font> <a href="css0401.htm">CSS定位</a><br>
<font color="#CC3399">→</font> CSS濾鏡<br>
1.<a href="css0501.htm">概述</a><br>
2.<a href="css0502.htm">Alpha屬性</a><br>
3.Blur屬性<br>
4.<a href="css0505.htm">Chroma屬性</a><br>
5.<a href="css0506.htm">Dropshadow屬性</a><br>
6.<a href="css0507.htm">Fliph、Fliv屬性</a><br>
7.<a href="css0508.htm">Gray屬性</a><br>
8.<a href="css0309.htm">Glow屬性</a><br>
9.<a href="css0510.htm">Invert屬性</a><br>
<br>
<br>
</p>
<p align="center" class=p1><a href=/pc/bin/msg.pl?file_id=k_css target="_blank"><img src="/pc/img/message.gif" width="64" height="54" alt="請您留言" border="0"><br> 談談您的看法</a>
<br>
<script language="javascript">
speak_num="za"
</script>
<script language="javascript" src=/pc/var/pc_k_css.js>
</script>
<script language="javascript">
var num=0
if (!isNaN(speak_num)){
num=speak_num;
}
else{
num=0
}
document.writeln ("已有")
document.writeln (num)
</script>
</p>
<p class="p1" style="line-height:17pt" align="left"> </p>
</td>
<td width=1 bgcolor=#0586D7 height="123"><img src="/pc/img/blank.gif" width="1" height="1">
</td><td width=15 background="/pc/img/line.gif"><p> </p></td>
<td valign="top" background="/pc/img/line.gif" width="584" height="123" class="p2">
<p align="center"><b><span class="p3"><br>
<font color="#3366CC">五、CSS濾鏡</font></span></b></p>
<p align="right" class="p1"> </p>
<hr color=blue size=1>
<p class="p2" style="line-height:17pt"> <font color="336633"><b>3、blur屬性</b></font></p>
<p class="p2" style="line-height:17pt"> 假如您用手在一幅還沒干透的油畫上迅速劃過,畫面就會變得模糊。CSS下的blur屬性就會達到這種模糊的效果。
<br>
先來看一下blur屬性的表達式: </p>
<p class="p2" style="line-height:17pt"> <font color="006666">filter:blur(add=add,direction,strength=strength)</font>
</p>
<p class="p2" style="line-height:17pt"> 我們看到blur屬性有三個參數:add、direction、strength。
<br>
Add參數有兩個參數值:true和false。意思是指定圖片是否被改變成模糊效果。 Direction參數用來設置模糊的方向。模糊效果是按照順時針方向進行的。其中0度代表垂直向上,每45度一個單位,默認值是向左的270度。角度方向的對應關系見下表:</p>
<p align="center"><img src="img/css067.gif" width="216" height="196" border="0" alt="角度列表">
</p>
還是看一個例子吧。<em class="p3"><a href="sl/reblur.htm" target="_blank">點擊這里看效果</a></em>
</p>
<p class="p2" style="line-height:17pt"> 看起來是不是有些像萬花筒,在這個例子中加入了一些JavaScript的語句,代碼如下:</p>
<p class="p2" style="line-height:17pt"> <font color="006666"><html>
<br>
<head> <br>
<title>blur css</title> <br>
<script> <br>
function handlechange(obj) <br>
</font> <font color="CC33CC">//*設置一個循環函數handlechange,對象是obj*//</font>
<br>
<font color="006666">{ with(obj.filters(0))</font><font color="CC33CC">//*Obj的filter屬性*//</font>
<br>
<font color="006666">{ if (strength<255)</font><font color="CC33CC">//*設置循環條件*//</font>
<br>
<font color="006666">{ strength +=1;direction +=45;}</font><br>
<font color="CC33CC">//*每循環一次strength就加1,direction加45度*//</font>
<br>
<font color="006666">} <br>
} <br>
</script> <br>
</head> <br>
<body> <br>
<p><img id =“img1” src=“ss01087.jpg” <br>
style=“filter:blur(strength=1)”<br>
onfilterchange=“handlechange(this)”></font> <br>
<font color="CC33CC">//*導入一幅圖片,初始blur屬性strength等于1,同時調用onfilterchange函<br> 數*//</font>
<br>
<font color="006666"></p> <br>
</body> <br>
</html> </font></p>
<p class="p2" style="line-height:17pt"><font color="006666"> </font>注:在javascript中blur屬性是這樣定義的:<font color="006666">
<br>
[oBlurfilter=] object.Filters.blur</font></p>
<p class="p2" style="line-height:17pt"><font color="006666"> </font> 這個例子是Blur屬性的一個比較復雜的例子,下一節我將向您介紹兩個較簡單的blur屬性效果。</p>
<hr color=blue size=1>
<p class="p1" align="right"><a href="css0502.htm">上一節</a> <a href="css0504.htm">下一節</a> </p>
<p> </p>
<p align="center" class=p2><a href=/pc/bin/msg.pl?file_id=k_css target="_blank"><img src="/pc/img/message.gif" width="64" height="54" alt="請您留言" border="0"><br> 談談您的看法</a>
<script language="javascript">
speak_num="za"
</script>
<script language="javascript" src=/pc/var/pc_k_css.js>
</script>
<script language="javascript">
var num=0
if (!isNaN(speak_num)){
num=speak_num;
}
else{
num=0
}
document.writeln ("已有")
document.writeln (num)
document.writeln ("條發言")
</script>
</p>
<p> </p></td><td width=15 background="/pc/img/line.gif"><p> </p></td>
</tr>
</table>
<!--底部開始-->
<script language="Javascript" src="/pub/js/foot.js"></script>
<!--底部結束-->
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -