读书人

DIV式样总结(二)

发布时间: 2012-11-20 09:55:43 作者: rapoo

DIV样式总结(二)

二、一些特殊效果:

1、cursor:设置DIV上光标的样式。

2、clip:设置剪辑矩形。

例:


DIV式样总结(二)<div?style="font:16px?宋体;width:600px;height:200px;?cursor:help;?clip:rect(0px?100px?20px?0px);?line-height:20px;?overflow:auto;background-color:Yellow;position:absolute">
DIV式样总结(二)div样式测式how?areyou.
DIV式样总结(二)</div>
DIV式样总结(二)
DIV式样总结(二)

说明:clip:rect(top right bottom left);设置上下左右的距离,但此时要把position指定为absolute。看以上效果。

3、filter:滤镜效果。

例:


DIV式样总结(二)<div?style="width:450px;height:200px;background-color:Blue;">
DIV式样总结(二)?????<div?id=”tdiv”?style="background-color:Yellow;?filter:alpha(opacity=50);opacity:0.5;
DIV式样总结(二)float:left;?width:200px;height:200px;"?>
DIV式样总结(二)?????</div>
DIV式样总结(二)?????<div?style="background-color:Yellow;?width:200px;height:200px;float:left;">
DIV式样总结(二)?????</div>
DIV式样总结(二)</div>
DIV式样总结(二)
DIV式样总结(二)

说明:设置透明度:opacity:value (FF专用,value的取值为0至1之间的小数),filter:alpha(opacity=value)(IE专用,value取值:0至100)。

如果要有JavaScript改变DIV的透明度可用下面的方法:

FF中:document.getElementById('tdiv').style.opacity='0.9';

IE中:document.getElementById('tdiv').style.filter='alpha(opacity=90)';

?

*?以下是滤镜综合的例子,将以下代码复制到一个网页文件中就可看到其效果,所以就不要加以说明了。

例:

?


DIV式样总结(二)<style?type="text/css">
DIV式样总结(二)???????#paneldiv?div
DIV式样总结(二)???????{
DIV式样总结(二)??????????background-Color:yellow;
DIV式样总结(二)??????????height:200px;
DIV式样总结(二)??????????width:200px;
DIV式样总结(二)???????}
DIV式样总结(二)</style>
DIV式样总结(二)
DIV式样总结(二)<div?id="paneldiv"?style="width:230px;height:2300px;
DIV式样总结(二)background-color:Blue;">
DIV式样总结(二)????<div?style="filter:alpha(opacity=0,finishopacity=80,style=1,
DIV式样总结(二)startx=10,starty=10,FinishX=100,?FinishY=100);opacity:0.5;">
DIV式样总结(二)?????alpha效果:<br?/>
DIV式样总结(二)????</div>
DIV式样总结(二)
DIV式样总结(二)????<div?style="filter:blur(add=1,direction=100,strength=5);">
DIV式样总结(二)??????????????blur效果:<br?/>
DIV式样总结(二)??????????????add为1代表字有阴影,0代表字全部模糊。
DIV式样总结(二)??????????????abcdefghijklmnopqrstuvwxyz
DIV式样总结(二)????</div>
DIV式样总结(二)????<div?style="filter:chroma(color='#ff0000')"?onclick="this.style.backgroundColor='#ff0000'"?ondblclick="this.style.backgroundColor='black';">
DIV式样总结(二)???????chroma效果:<br?/>
DIV式样总结(二)???????原为黄色,单击变成红色变成透明,双击变成黑色。
DIV式样总结(二)????</div>
DIV式样总结(二)????<div?style="filter:FlipH;">
DIV式样总结(二)??????????????fliph效果:<br?/>
DIV式样总结(二)??????????????ABCDEFGH<br?/>
DIV式样总结(二)??????????????IJKLMNOP<br?/>
DIV式样总结(二)??????????????此属性在设置宽高后有效
DIV式样总结(二)????</div>
DIV式样总结(二)????<div?style="filter:FlipV;">
DIV式样总结(二)??????????????flipv效果:<br?/>
DIV式样总结(二)??????????????ABCDEFGH<br?/>
DIV式样总结(二)??????????????IJKLMNOP<br?/>
DIV式样总结(二)??????????????此属性在设置宽高后有效
DIV式样总结(二)????</div>
DIV式样总结(二)????<div?style="filter:gray;">
DIV式样总结(二)?????????gray效果:<br?/>
DIV式样总结(二)?????????abcdefghijklmn
DIV式样总结(二)????</div>
DIV式样总结(二)????<div?style="filter:invert;?text-transform:uppercase;color:Red;">
DIV式样总结(二)???????????????invert效果:<br?/>
DIV式样总结(二)???????????????背景色变成相反颜色,如黑变成白。
DIV式样总结(二)????</div>
DIV式样总结(二)????<div?style="filter:wave(add=0,freq=3,lightstrength=20,phase=3,strength=10)">
DIV式样总结(二)???????????????wave效果:<br?/>
DIV式样总结(二)???????????????Add:一般为1,或0。(0表示上下波浪)?
DIV式样总结(二)  ???????????Freq:变形值。(指定多少个波浪)
DIV式样总结(二)  ???????????LightStrength:变形百分比。(变形后的阴影。)
DIV式样总结(二)  ???????????Phase:角度变形百分比。(弯曲的角度)??Strength:变形强度。(数值越大,DIV变形就越大。)
DIV式样总结(二)????</div>
DIV式样总结(二)????<div?style="filter:Xray">
DIV式样总结(二)?????????xray效果:<br?/>
DIV式样总结(二)?????????sfasdfasdfasdfsadf
DIV式样总结(二)????</div>
DIV式样总结(二)<div?style="filter:?progid:DXImageTransform.Microsoft.Gradient
DIV式样总结(二)(GradientType=0,?StartColorStr='#B5CCFA',?EndColorStr='#ffffff');">
DIV式样总结(二)???????progid:dximagetransform.microsoft.gradient效果:<br?/>
DIV式样总结(二)???????endendendendendendendendendend
DIV式样总结(二)????</div>
DIV式样总结(二)</div>
DIV式样总结(二)<div?style="filter:DropShadow(color='#666666',OffX='3',OffY='3',
DIV式样总结(二)Positive='1');width:200px;height:200px;">
DIV式样总结(二)?????????dropshadow效果:<br?/>
DIV式样总结(二)?????????此效果只有在不设置背景色时有效,这时Color指定的将成为背景色。此时背上的字将是清晰的。positive为0时color将成为背景色,为1时color只是文本投影的颜色。
DIV式样总结(二)????</div>
DIV式样总结(二)<div?style="filter:Glow(color='#0000ff',strength='3');
DIV式样总结(二)width:100px;height:100px;">
DIV式样总结(二)?????????glow效果:<br?/>
DIV式样总结(二)?????????strength的光的强度0--100;此时不能设DIV的背景色。
DIV式样总结(二)????</div>
DIV式样总结(二)<div?style="filter:mask(color='ff0000');?width:100px;
DIV式样总结(二)height:100px;text-transform:uppercase;color:black;?">
DIV式样总结(二)???????????mask效果:<br?/>
DIV式样总结(二)???????????没有明显效果,不能设背景色。
DIV式样总结(二)???</div>
DIV式样总结(二)???<div?style="filter:shadow(color='0000ff',direction='100');
DIV式样总结(二)width:100px;height:100px;">
DIV式样总结(二)???????????????shadow效果:<br?/>
DIV式样总结(二)???????????????abcdefghijklmn
DIV式样总结(二)???</div>
DIV式样总结(二)???<div?style="filter:Xray;width:100px;height:100px;
DIV式样总结(二)background-color:red;">
DIV式样总结(二)???????xray效果:<br?/>
DIV式样总结(二)??????sfasdfasdfasdfsadf
DIV式样总结(二)???</div>
DIV式样总结(二)???<div?style="filter:?progid:DXImageTransform.Microsoft.Gradient
DIV式样总结(二)(GradientType=100,?StartColorStr='#B5CCFA',?EndColorStr='#ffffff');width:100px;height:100px;">
DIV式样总结(二)????????渐变效果。
DIV式样总结(二)????????endendendendendendendendendend
DIV式样总结(二)??</div>
DIV式样总结(二)??<div?style="filter:progid:dXImageTransform.Microsoft.Pixelate(maxsquare=5);width:100px;height:100px;">
DIV式样总结(二)???????????????lsksalsslalalalalalalal
DIV式样总结(二)?</div>
DIV式样总结(二)?<div?style="filter:alpha(opacity=100,?finishOpacity=0,style=2);
DIV式样总结(二)width:100px;?height:100px;background-color:Yellow;">
DIV式样总结(二)</div>

?

此上滤镜效果主要参考:

http://www.lao8.org/html/8/2008-1-21/2008121182204.html

http://ce.sysu.edu.cn/hope/Education/ShowArticle.asp?ArticleID=2117;

(转自: http://www.cnblogs.com/skylaugh/archive/2009/05/09/1453124.html)

读书人网 >Web前端

热点推荐