新聞中心
本文和大家重點(diǎn)討論一下DIV樣式中一些特殊效果的實(shí)現(xiàn),比如cursor:它可以設(shè)置DIV上光標(biāo)的樣式,clip:可以設(shè)置剪輯矩形,而DIV樣式filter:可以實(shí)現(xiàn)濾鏡效果,相信本文介紹一定會(huì)讓你有所收獲。

DIV樣式中一些特殊效果
1、cursor:設(shè)置DIV上光標(biāo)的樣式。
2、clip:設(shè)置剪輯矩形。
例:
Code
- cursor:help;clip:rect(0px100px20px0px);line-height:20px;
- overflow:auto;background-color:Yellow;position:absolute">
- div樣式測(cè)式howareyou.
說明:clip:rect(toprightbottomleft);設(shè)置上下左右的距離,但此時(shí)要把position指定為absolute。看以上效果。
3、filter:此DIV樣式可以實(shí)現(xiàn)濾鏡效果。
例:
Code
- filter:alpha(opacity=50);opacity:0.5;
- float:left;width:200px;height:200px;">
說明:設(shè)置透明度:opacity:value(FF專用,value的取值為0至1之間的小數(shù)),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)';
*以下是濾鏡綜合的例子,將以下代碼復(fù)制到一個(gè)網(wǎng)頁(yè)文件中就可看到其效果,所以就不要加以說明了。#p#
例:
濾鏡綜合例子
- #paneldivdiv
- {}{
- background-Color:yellow;
- height:200px;
- width:200px;
- }
- background-color:Blue;">
- startx=10,starty=10,FinishX=100,FinishY=100);opacity:0.5;">
- alpha效果:


咨詢
建站咨詢
