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

CSS中輕松實現Firefox與IE透明度

開發 前端
本文向大家描述一下CSS中實現Firefox與IE透明度(opacity)的不同方法,Dreamweaver提供的透明度樣式只能支持IE,想要在Firefox下實現,需要自己手寫。

你對CSS中實現Firefox與IE透明度的概念是否了解,這里和大家分享幾種實現Firefox與IE透明度的方法,希望對你的學習有所幫助。

CSS中實現Firefox與IE透明度(opacity)的不同方法

Dreamweaver提供的透明度樣式只能支持IE,想要在Firefox下實現,需要自己手寫。如下:

1.IE6設置透明度

CSS設置

filter:alpha(opacity=50);

javascript設置

IESpanJs.style.filter=“alpha(opacity=50)”;

2.Firefox3.5設置透明度

Firefox3.5支持CSS3,已經不對原來的透明度樣式(-moz-opacity)提供支持(網上查的),在本人的Firefox3.5.5上測試后,發現確實如此,現在的透明度設置為:

CSS設置

opacity:0.5;

javascript設置

FirefoxSpanJs.style.mozOpacity=“0.5″;

3.Firefox3.5以前版本設置透明度

CSS設置

-moz-opacity:0.5;

javascript設置

FirefoxSpanJs.style.mozOpacity=“0.5″;

4.demo代碼

  1. <HTML>   
  2. <HEAD>   
  3. <style type=“text/CSS”>   
  4. .IECSS {   
  5. display:-moz-inline-box;   
  6. display:inline-block;   
  7. width:100;   
  8. height:100;   
  9. background-color:red;   
  10. filter:alpha(opacity=50);   
  11. }   
  12. .Firefox35CSS {   
  13. display:-moz-inline-box;   
  14. display:inline-block;   
  15. width:100;   
  16. height:100;   
  17. background-color:blue;   
  18. opacity:0.5;   
  19. }   
  20. .FirefoxCSS {   
  21. display:-moz-inline-box;   
  22. display:inline-block;   
  23. width:100;   
  24. height:100;   
  25. background-color:yellow;   
  26. -moz-opacity:0.5;   
  27. }   
  28. </style>   
  29.     
  30. <script>   
  31. window.onload = function() {   
  32. //設置IE   
  33. var IESpanJs = document.getElementById(“IESpanJs”);   
  34. IESpanJs.style.display = “inline-block”;  //IE支持   
  35. IESpanJs.style.width = 100;   
  36. IESpanJs.style.height = 100;   
  37. IESpanJs.style.backgroundColor = “red”;   
  38. IESpanJs.style.filter=“alpha(opacity=50)”;   
  39.     
  40. //設置Firefox3.5.*   
  41. var Firefox35SpanJs = document.getElementById(“Firefox35SpanJs”);   
  42. try   
  43. {   
  44. Firefox35SpanJs.style.display = “-moz-inline-box”; //Firefox支持   
  45. }   
  46. catch (e)   
  47. {   
  48. Firefox35SpanJs.style.display = “inline-block”; //支持IE   
  49. }   
  50.     
  51. Firefox35SpanJs.style.width = 100;   
  52. Firefox35SpanJs.style.height = 100;   
  53. Firefox35SpanJs.style.backgroundColor = “blue”;   
  54. Firefox35SpanJs.style.opacity=“0.5″;   
  55.     
  56. //設置Firefox   
  57. var FirefoxSpanJs = document.getElementById(“FirefoxSpanJs”);   
  58. try   
  59. {   
  60. FirefoxSpanJs.style.display = “-moz-inline-box”; //Firefox支持   
  61. }   
  62. catch (e)   
  63. {   
  64. FirefoxSpanJs.style.display = “inline-block”; //支持IE   
  65. }   
  66.     
  67. FirefoxSpanJs.style.width = 100;   
  68. FirefoxSpanJs.style.height = 100;   
  69. FirefoxSpanJs.style.backgroundColor = “yellow”;   
  70. FirefoxSpanJs.style.mozOpacity=“0.5″;   
  71.     
  72. }   
  73. </script>   
  74.     
  75. </HEAD>   
  76.     
  77. <BODY>   
  78. <span id=“IESpanCSS” class=“IECSS”>IE_CSS</span>   
  79. <span id=“Firefox35SpanCSS” class=“Firefox35CSS”>Firefox3.5_CSS</span>   
  80. <span id=“FirefoxSpanCSS” class=“FirefoxCSS”>Firefox_CSS</span>   
  81. <br>   
  82. <br>   
  83. <span id=“IESpanJs”>IE_Js</span>   
  84. <span id=“Firefox35SpanJs”>Firefox3.5_Js</span>   
  85. <span id=“FirefoxSpanJs”>Firefox_Js</span>   
  86. </BODY>   
  87. </HTML>   
  88.  

  文章來源: Div-CSS.net設計網 參考:http://www.div-CSS.net/div_CSS/topic/index.asp?id=10037

【編輯推薦】

  1. CSS中padding和margin屬性用法說明
  2. 探究IE8與IE7具體功能中窗口功能按鈕的變化
  3. 剖析Margin和Padding屬性中四個值的先后順序及區別
  4. 九步輕松解決IE6的各種疑難雜癥
  5. 技術前沿 一段JS代碼輕松解決IE6-IE8的兼容性問題
責任編輯:佚名 來源: div-CSS.net
相關推薦

2020-12-01 10:54:41

GIMP圖片透明度

2010-09-13 15:32:38

DIV背景

2020-11-27 08:51:29

CSSOpacity透明度

2022-02-15 09:31:43

透明度CSS

2024-08-02 12:05:00

2022-05-16 10:29:17

開源社區透明度開發者

2009-11-03 17:35:05

VB.NET窗體透明度

2019-10-10 10:30:07

云計算云安全公共云

2024-01-17 08:22:23

16進制值透明度顏色值

2010-08-31 09:24:29

FireFoxIECSS

2010-09-01 15:16:47

CSSIEFirefox

2025-06-17 03:10:00

2010-08-27 15:56:52

IEFirefoxCSS

2010-08-20 14:47:02

IEFirefoxCSS

2024-03-06 11:43:42

2024-07-30 09:43:59

2010-08-16 15:15:12

CSSFireFoxIE

2020-09-17 14:32:52

AI

2013-05-29 14:17:42

點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 久久国产日韩欧美 | 欧美一级大片 | 天天操天天插 | 91精品国产综合久久香蕉麻豆 | 免费黄色在线观看 | 久久噜噜噜精品国产亚洲综合 | 999久久久久久久久6666 | 欧美一级黄色免费看 | 精品成人| 国产女人与拘做视频免费 | 成人影院网站ww555久久精品 | 亚洲图片视频一区 | 久久久国产精品 | 欧美亚洲成人网 | 免费看的黄网站 | 国产精品亚洲欧美日韩一区在线 | 美日韩中文字幕 | 亚洲少妇综合网 | 久久久精品综合 | 日韩欧美在线视频一区 | 中国美女av | 在线观看不卡av | www国产亚洲精品 | 亚洲国产精品成人久久久 | 老外黄色一级片 | 中文字幕 亚洲一区 | 91干b| 国产精品久久久久一区二区三区 | 日韩欧美在线视频一区 | 亚洲日本一区二区三区四区 | 狠狠干在线 | 91免费电影 | 亚洲欧美综合精品久久成人 | 亚洲高清成人在线 | 亚洲资源站| 欧美成ee人免费视频 | 国产成人99久久亚洲综合精品 | 欧美精三区欧美精三区 | 午夜影院在线观看 | 天堂成人国产精品一区 | 亚洲成人三区 |