读书人

巧用CSS打造艺术字

发布时间: 2012-11-22 00:16:41 作者: rapoo

巧用CSS制作艺术字

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
<!--
.title_1 { font-family: "Verdana"; font-size: 12px; color: #E1E4EC; width: 100%; filter: DropShadow(Color=#213C63, OffX=1, OffY=1)}
.text { font-family: "Verdana"; font-size: 12px; line-height: 16px; color: #666699; text-decoration: none}
.unnamed1 { filter: DropShadow(Color=#FFFFFF, OffX=1, OffY=1)}
-->
</style>
</head>

<body>


<table width="500" border="0" cellspacing="1" cellpadding="0" bgcolor="#8C96B5" align="center">
<tr>
<td bgcolor="#FFFFFF">
<table class=all bordercolordark=#ffffff width="100%"
bordercolorlight=#000000 border=0 cellspacing="1" cellpadding="0">
<tr bgcolor="#8C96B5">
<td colspan=2 bgcolor="#8C96B5" width="100%" height="16">
<div align="center" border="0" cellspacing="8" cellpadding="0" border="0" cellspacing="8" cellpadding="0" height="50">
<tr>
<td style="FILTER: blur(direction=135,strength=8)" align="center"><font face="黑体" color="#8C96B5" size="6"><b><i>美丽心情</i></b></font></td>
</tr>
</table>
<br>
用blur滤镜做出的效果,代码如下:<br>
<b>FILTER: blur(direction=135,strength=8)</b></td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#E1E4EC">
<table width="100%" border="0" cellspacing="8" cellpadding="0" height="50">
<tr>
<td style="FILTER: dropshadow(color=#B4BBCF,offx=6,offy=6,positive=1)" align="center"><font face="黑体" color="#8C96B5" size="6"><b><i>美丽心情</i></b></font></td>
</tr>
</table>
<br>
用dropshadow滤镜做出的效果,代码如下:<br>
<b>FILTER: dropshadow(color=#B4BBCF,offx=6,offy=6,positive=1)</b></td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#E1E4EC">
<table width="100%" border="0" cellspacing="8" cellpadding="0" height="50">
<tr>
<td style="FILTER: glow(color=#B4BBCF,strength=5)" align="center"><font face="黑体" color="#8C96B5" size="6"><b><i>美丽心情</i></b></font></td>
</tr>
</table>
<br>
用glow滤镜做出的效果,代码如下:<br>
<b>FILTER: glow(color=#B4BBCF,strength=5)</b></td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#E1E4EC">
<table width="100%" border="0" cellspacing="8" cellpadding="0" height="50">
<tr>
<td style="FILTER: alpha(opacity=100,finishiopacity=0,style=1)shadow(color=#8C96B5,direction=135)" align="center"><font face="黑体" color="#8C96B5" size="6"><b><i>美丽心情</i></b></font></td>
</tr>
</table>
<br>
这个效果用到了两种滤镜:shadow和alpha,代码如下:<br>
<b>FILTER: alpha(opacity=100,finishiopacity=0,style=1)<br>
shadow(color=#8C96B5,direction=135)</b> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#E1E4EC">
<table width="100%" border="0" cellspacing="8" cellpadding="0" height="50">
<tr>
<td style="FILTER: mask(color=#E1E4EC)shadow(color=#8C96B5,direction=135)chroma(color=#E1E4EC)" align="center"><font face="黑体" color="#8C96B5" size="6"><b><i>美丽心情</i></b></font></td>
</tr>
</table>
<br>
这个效果也用到两个滤镜mask和shadow,代码如下:<br>
<b>FILTER: mask(color=#E1E4EC)<br>
shadow(color=#8C96B5,direction=135)chroma(color=#E1E4EC)</b><br>
<br>
注意:mask的颜色要和网页背景色一致,字体的颜色由shadow决定。</td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#E1E4EC">
<table width="100%" border="0" cellspacing="8" cellpadding="0" height="50">
<tr>
<td style="FILTER: mask(color=#E1E4EC)dropshadow(color=#B4BBCF,offx=-3,offy=-3,positive=1)chroma(color=#E1E4EC)" align="center"><font face="黑体" color="#8C96B5" size="6"><b><i>美丽心情</i></b></font></td>
</tr>
</table>
<br>
如果说上面的效果是阴文的话,那么这个效果的应该算是阳文了,用两个滤镜实现mask和dropshadow,注意mask的颜色要和网页背景色一致,或者把mask和chroma成对使用,也可达到同样效果。代码如下:<br>
<b>FILTER: mask(color=#E1E4EC)<br>
dropshadow(color=#B4BBCF,offx=-3,offy=-3,positive=1)<br>
chroma(color=#E1E4EC)"</b> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#E1E4EC">
<table width="100%" border="0" cellspacing="8" cellpadding="0" height="50">
<tr>
<td style="FILTER: glow(color=#8C96B5,strength=2)shadow(color=#B4BBCF,direction=135)" align="center"><font face="黑体" color=#E1E4EC size=6><b><i>美丽心情</i></b></font></td>
</tr>
</table>
<br>
用glow滤镜可以做空心字,方法是将字体颜色设置为背景色,再将glow滤镜的strenght的值设置为1或2即可。这个效果的代码如下:<br>
<b>FILTER: glow(color=#8C96B5,strength=2)<br>
shadow(color=#B4BBCF,direction=135)</b> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#E1E4EC">
<table width="100%" border="0" cellspacing="8" cellpadding="0">
<tr>
<td border=0>
<tr>
<td style="FILTER: mask(color=#E1E4EC)shadow(color=#B4BBCF,direction=135)chroma(color=#E1E4EC)" align="center"><font face="黑体" color=#8C96B5 size=6><b><i>美丽心情</i></b></font></td>
</tr>
</table>
<br>
<br>
<table height=150 width=200 align=center background="http://www.e-flowing.com/1/bg_2.jpg" border=0>
<tr>
<td style="FILTER: glow(strength=1)mask(color=#B4BBCF)chroma(color=#B4BBCF)" align="center" height=54><font face="黑体" color=#8C96B5 size=6><b><i>美丽心情</i></b></font></td>
</tr>
</table>
<br>
<br>
<table height=150 width=200 align=center background="http://www.e-flowing.com/1/bg_3.jpg" border=0>
<tr>
<td style="FILTER: mask(color=#E1E4EC)dropshadow(color=#B4BBCF,offx=-3,offy=-3,positive=1)chroma(color=#E1E4EC)" align="center" height=54><font face="黑体" color=#8C96B5 size=6><b><i>美丽心情</i></b></font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td border="0" cellspacing="8" cellpadding="0">
<tr>
<td border=0>
<tr>
<td style="FILTER: glow(strength=4)mask(color=#E1E4EC)" height=109 align="center" valign="middle"><font face="Verdana" color="#8C96B5" size="6"><i><b>WELCOME
TO</b></i></font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="unnamed1"><font class="text">这个效果的代码:<br>
<b>FILTER: glow(strength=4)mask(color=#E1E4EC)</b></font></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

?

说明:

投影字是用dropshadow滤镜做出的效果.

FILTER: dropshadow(color=#FFCCFF,offx=6,offy=6,positive=1)

=============================================

阴文字是用滤镜mask, shadow, chroma组合. 字体的颜色由shadow决定,mask和chroma的颜色要相同,色彩任意。

FILTER: mask(color=#a09261) shadow(color=#000000,direction=135) chroma(color=#a09261)

=============================================

阳文字是用滤镜mask, dropshadow, chroma组合. mask和chroma的颜色相同,色彩由dropshadow决定。

FILTER: mask(color=#a09261) dropshadow(color=#000000,offx=-3,offy=-3,positive=1) chroma(color=#a09261)

=============================================


空心字是用滤镜glow, mask, chroma组合. mask和chroma的颜色要相同,这个颜色决定了字体的颜色。

FILTER: glow(strength=1) mask(color=#ff00ff) chroma(color=#ff00ff)

=============================================

齿边字是用滤镜glow, mask组合. mask的颜色决定字体的颜色。

FILTER: glow(strength=30) mask(color=blue)

=============================================

?

?

滤镜:

1.滤镜:alpha
语法:
STYLE="filter:Alpha(Opacity=opacity,FinishOpacity=finishopacity,Style=style,
StartX=startX,StartY=startY,FinishX=finishX,FinishY=finishY)"
说明:
Opacity:起始值,取值为0-100,0为透明,100为原图.
FinishOpacity:目标值.
Style:1或2或3
StartX:任意值
StartY:任意值
例子:filter:Alpha(Opacity="0",FinishOpacity="40",Style="2")


2.滤镜:blur
语法:
STYLE="filter:Blur(Add=add,Direction=direction,
Strength=strength)"
说明:
Add:一般为1,或0.
Direction:角度,0-315度,步长为45度.
Strength:效果增长的数值,一般5即可.
例子:filter:Blur(Add="1",Direction="45",Strength="5")


3.滤镜:chroma
语法:
STYLE="filter:Chroma(Color=color)"
说明:
color:#rrggbb格式,任意.
例子:filter:Chroma(Color="#FFFFFF")


4.滤镜:DropShadow
语法:
STYLE="filter:DropShadow(Color=color,OffX=offX,OffY=offY,Positive=positive)"
说明:
Color:#rrggbb格式,任意.
Offx:X轴偏离值.
Offy:Y轴偏离值.
Positive:1或0.
例子:filter:DropShadow(Color="#6699CC",OffX="5",OffY="5",
Positive="1")


5.滤镜:FlipH
语法:
STYLE="filter:FlipH"
例子:filter:FlipH


6.滤镜:FlipV
语法:
STYLE="filter:FlipV"
例子:filter:FlipV


7.滤镜:Glow
语法:
STYLE="filter:Glow(Color=color,Strength=strength)"
说明:
Color:发光颜色.
Strength:强度(0-100)
例子:filter:Glow(Color="#6699CC",Strength="5")


8滤镜:Gray
语法:
STYLE="filter:Gray"
例子:filter:Gray


9.滤镜:Invert
语法:
STYLE="filter:Invert"
例子:filter:Invert


10.滤镜:Mask
语法:
STYLE="filter:Mask(Color=color)"
例子:filter:Mask(Color="#FFFFE0")


11.滤镜:Shadow
语法:
filter:Shadow(Color=color,Direction=direction)
说明:
Color:#rrggbb格式.
Direction:角度,0-315度,步长为45度.
例子:filter:Shadow(Color="#6699CC",Direction="135")


12.滤镜:Wave
语法:
filter:Wave(Add=add,Freq=freq,LightStrength=strength,Phase=phase,
Strength=strength)
说明:
Add:一般为1,或0.
Freq:变形值.
LightStrength:变形百分比.
Phase:角度变形百分比.
Strength:变形强度.
例子:filter:wave(Add="0",Phase="4",Freq="5",LightStrength="5",Strength="2")

读书人网 >CSS

热点推荐