成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

DIV樣式中幾個特殊效果實現

開發 前端
你對DIV樣式中的一些特殊效果是否熟悉,這里向大家簡單描述一下,主要包括cursor:設置DIV上光標的樣式,clip:設置剪輯矩形以及filter:濾鏡效果等,相信你一定會對本文介紹感興趣。

本文和大家重點討論一下DIV樣式中一些特殊效果的實現,比如cursor:它可以設置DIV上光標的樣式,clip:可以設置剪輯矩形,而DIV樣式filter:可以實現濾鏡效果,相信本文介紹一定會讓你有所收獲。

DIV樣式中一些特殊效果

1、cursor:設置DIV上光標的樣式。

2、clip:設置剪輯矩形。

例:

Code

  1. <divstyledivstyle="font:16px宋體;width:600px;height:200px;  
  2. cursor:help;clip:rect(0px100px20px0px);line-height:20px;  
  3. overflow:auto;background-color:Yellow;position:absolute"> 
  4. div樣式測式howareyou.  
  5. </div> 
  6.  

說明:clip:rect(toprightbottomleft);設置上下左右的距離,但此時要把position指定為absolute。看以上效果。

3、filter:此DIV樣式可以實現濾鏡效果。

例:

Code 

  1. <divstyledivstyle="width:450px;height:200px;background-color:Blue;"> 
  2. <dividdivid=”tdiv”style="background-color:Yellow;  
  3. filter:alpha(opacity=50);opacity:0.5;  
  4. float:left;width:200px;height:200px;"> 
  5. </div> 
  6. <divstyledivstyle="background-color:Yellow;width:200px;  
  7. height:200px;float:left;"> 
  8. </div> 
  9. </div> 
  10.  

 說明:設置透明度: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)';

*以下是濾鏡綜合的例子,將以下代碼復制到一個網頁文件中就可看到其效果,所以就不要加以說明了。#p#

例:

濾鏡綜合例子

  1. <styletypestyletype="text/css"> 
  2. #paneldivdiv  
  3. {}{  
  4. background-Color:yellow;  
  5. height:200px;  
  6. width:200px;  
  7. }  
  8. </style> 
  9.  
  10. <dividdivid="paneldiv"style="width:230px;height:2300px;  
  11. background-color:Blue;"> 
  12. <divstyledivstyle="filter:alpha(opacity=0,finishopacity=80,style=1,  
  13. startx=10,starty=10,FinishX=100,FinishY=100);opacity:0.5;"> 
  14. alpha效果:<br/> 
  15. </div> 
  16.  
  17. <divstyledivstyle="filter:blur(add=1,direction=100,strength=5);"> 
  18. blur效果:<br/> 
  19. add為1代表字有陰影,0代表字全部模糊。  
  20. abcdefghijklmnopqrstuvwxyz  
  21. </div> 
  22. <divstyledivstyle="filter:chroma(color='#ff0000')"
  23. onclick="this.style.backgroundColor='#ff0000'"  
  24. ondblclick="this.style.backgroundColor='black';"> 
  25. chroma效果:<br/> 
  26. 原為黃色,單擊變成紅色變成透明,雙擊變成黑色。  
  27. </div> 
  28. <divstyledivstyle="filter:FlipH;"> 
  29. fliph效果:<br/> 
  30. ABCDEFGH<br/> 
  31. IJKLMNOP<br/> 
  32. 此屬性在設置寬高后有效  
  33. </div> 
  34. <divstyledivstyle="filter:FlipV;"> 
  35. flipv效果:<br/> 
  36. ABCDEFGH<br/> 
  37. IJKLMNOP<br/> 
  38. 此屬性在設置寬高后有效  
  39. </div> 
  40. <divstyledivstyle="filter:gray;"> 
  41. gray效果:<br/> 
  42. abcdefghijklmn  
  43. </div> 
  44. <divstyledivstyle="filter:invert;text-transform:uppercase;color:Red;"> 
  45. invert效果:<br/> 
  46. 背景色變成相反顏色,如黑變成白。  
  47. </div> 
  48. <divstyledivstyle="filter:wave(add=0,freq=3,  
  49. lightstrength=20,phase=3,strength=10)"> 
  50. wave效果:<br/> 
  51. Add:一般為1,或0。(0表示上下波浪)  
  52.   Freq:變形值。(指定多少個波浪)  
  53.   LightStrength:變形百分比。(變形后的陰影。)  
  54.   Phase:角度變形百分比。(彎曲的角度)Strength:變形強度。  
  55. (數值越大,DIV變形就越大。)  
  56. </div> 
  57. <divstyledivstyle="filter:Xray"> 
  58. xray效果:<br/> 
  59. sfasdfasdfasdfsadf  
  60. </div> 
  61. <divstyledivstyle="filter:progid:DXImageTransform.Microsoft.Gradient  
  62. (GradientType=0,StartColorStr='#B5CCFA',EndColorStr='#ffffff');"> 
  63. progid:dximagetransform.microsoft.gradient效果:<br/> 
  64. endendendendendendendendendend  
  65. </div> 
  66. </div> 
  67. <divstyledivstyle="filter:DropShadow(color='#666666',OffX='3',OffY='3',  
  68. Positive='1');width:200px;height:200px;"> 
  69. dropshadow效果:<br/> 
  70. 此效果只有在不設置背景色時有效,這時Color指定的將成為背景色。  
  71. 此時背上的字將是清晰的。positive為0時color將成為背景色,  
  72. 為1時color只是文本投影的顏色。  
  73. </div> 
  74. <divstyledivstyle="filter:Glow(color='#0000ff',strength='3');  
  75. width:100px;height:100px;"> 
  76. glow效果:<br/> 
  77. strength的光的強度0--100;此時不能設DIV的背景色。  
  78. </div> 
  79. <divstyledivstyle="filter:mask(color='ff0000');width:100px;  
  80. height:100px;text-transform:uppercase;color:black;"> 
  81. mask效果:<br/> 
  82. 沒有明顯效果,不能設背景色。  
  83. </div> 
  84. <divstyledivstyle="filter:shadow(color='0000ff',direction='100');  
  85. width:100px;height:100px;"> 
  86. shadow效果:<br/> 
  87. abcdefghijklmn  
  88. </div> 
  89. <divstyledivstyle="filter:Xray;width:100px;height:100px;  
  90. background-color:red;"> 
  91. xray效果:<br/> 
  92. sfasdfasdfasdfsadf  
  93. </div> 
  94. <divstyledivstyle="filter:progid:DXImageTransform.Microsoft.Gradient  
  95. (GradientType=100,StartColorStr='#B5CCFA',EndColorStr='#ffffff');  
  96. width:100px;height:100px;"> 
  97. 漸變效果。  
  98. endendendendendendendendendend  
  99. </div> 
  100. <divstyledivstyle="filter:progid:dXImageTransform.
  101. Microsoft.Pixelate(maxsquare=5);  
  102. width:100px;height:100px;"> 
  103. lsksalsslalalalalalalal  
  104. </div> 
  105. <divstyledivstyle="filter:alpha(opacity=100,finishOpacity=0,style=2);  
  106. width:100px;height:100px;background-color:Yellow;"> 
  107. </div> 

【編輯推薦】

  1. DIV樣式中一些特殊效果用法舉例
  2. DIV樣式中常用屬性用法指導
  3. CSS中border和clear兩大屬性用法揭秘
  4. 實現DIV居中布局三種途徑
  5. 解讀DIV CSS網頁布局中CSS無效十個原因

 

 

責任編輯:佚名 來源: lao8.org
相關推薦

2009-12-25 14:25:39

WPF圖標

2010-08-24 14:10:44

div style

2010-08-17 10:16:37

DIV樣式

2009-12-29 14:26:04

WPF按鈕

2015-07-08 16:19:17

iOSUIVisualEff

2011-08-10 14:40:23

iPhone動畫

2017-01-22 17:25:55

Android放大鏡效果源碼分析

2013-07-05 10:26:40

Android

2022-07-28 14:33:32

webviewweb頁面

2010-08-03 11:29:09

Flex全屏

2010-09-10 14:33:32

SQL循環語句

2013-06-25 11:21:35

Android開發幻燈片效果Gallery

2010-09-14 12:58:41

DIV+CSS圓角

2010-09-07 09:30:25

DIV彈出jQuery

2017-02-14 17:29:42

Android毛玻璃虛化效果

2009-08-17 17:15:48

C# 進度條效果

2016-03-04 10:50:02

ios圓角高效添加

2010-08-13 09:47:58

Flex樣式定義

2010-09-10 10:54:24

DIV背景透明

2010-09-14 09:18:28

DIVCSS
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 一区二区三区在线免费 | 四虎成人免费视频 | 久久久一二三区 | 黑人精品| 亚洲精品一区二区三区中文字幕 | 国产区精品在线观看 | 亚洲高清在线 | 狠狠干狠狠操 | 天天插日日操 | 美女黄频| 黄色一级大片在线免费看产 | 亚州精品成人 | 91伊人| 婷婷久久综合 | 欧美在线一区二区三区 | 久久麻豆精品 | 成人国产精品一级毛片视频毛片 | 欧美一级毛片久久99精品蜜桃 | 久久久国产精品一区 | 精品久久久久久久人人人人传媒 | 成人欧美一区二区三区在线播放 | 狠狠色狠狠色综合系列 | 日韩成人一区二区 | 视频第一区 | 992tv人人草| www日韩高清 | 国产成人综合在线 | 精品少妇一区二区三区在线播放 | 欧美在线亚洲 | 黄色免费在线观看网址 | h视频免费在线观看 | 欧美激情国产精品 | 免费看一级毛片 | 国产精品一二区 | 国产美女黄色片 | 999国产精品视频 | 国内精品一区二区三区 | 精品视频一区二区三区在线观看 | 亚洲精品一区中文字幕 | 成人午夜| 免费午夜电影 |