最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

CSS 圖像透明度opacity兼容性介紹

  發(fā)布時(shí)間:2013-09-08 15:18:27   作者:佚名   我要評(píng)論
CSS 圖像透明度opacity想必大家并不陌生吧,使其可以讓圖片或者頁(yè)面擁有透明效果,下面為大家講解下CSS opacity的使用及其兼容性,感興趣的朋友可以參考下
以前的兼容

復(fù)制代碼
代碼如下:

<span class="class">.transparent_class</span> <span class="rules">{
<span class="rule"><span class="attribute" style="color:rgb(181,137,0)">-ms-filter</span>:<span class="value"><span class="string" style="color:rgb(42,161,152)">"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"</span>;</span></span> <span class="comment" style="margin-bottom:0px!important; display:inline!important; vertical-align:top; color:rgb(88,110,117); font-style:italic">/* ie8 */</span>
<span class="rule"><span class="attribute" style="color:rgb(181,137,0)">filter</span>:<span class="value"><span class="function">alpha(opacity=<span class="number" style="color:rgb(42,161,152)">50</span>)</span>;</span></span> <span class="comment" style="margin-bottom:0px!important; display:inline!important; vertical-align:top; color:rgb(88,110,117); font-style:italic">/* ie5-7 */</span>
<span class="rule"><span class="attribute" style="color:rgb(181,137,0)">-moz-opacity</span>:<span class="value"><span class="number" style="color:rgb(42,161,152)">0.5</span>;</span></span> <span class="comment" style="margin-bottom:0px!important; display:inline!important; vertical-align:top; color:rgb(88,110,117); font-style:italic">/* old mozilla browser like netscape */</span>
<span class="rule"><span class="attribute" style="color:rgb(181,137,0)">-khtml-opacity</span>:<span class="value"> <span class="number" style="color:rgb(42,161,152)">0.5</span>;</span></span> <span class="comment" style="margin-bottom:0px!important; display:inline!important; vertical-align:top; color:rgb(88,110,117); font-style:italic">/* for really really old safari */</span>
<span class="rule"><span class="attribute" style="color:rgb(181,137,0)">opacity</span>:<span class="value"> <span class="number" style="color:rgb(42,161,152)">0.5</span>;</span></span> <span class="comment" style="margin-bottom:0px!important; display:inline!important; vertical-align:top; color:rgb(88,110,117); font-style:italic">/* css standard, currently it works in most modern browsers like firefox, */</span>
<span class="rule">}</span></span>

現(xiàn)在的兼容

復(fù)制代碼
代碼如下:

<span class="class">.transparent_class</span> <span class="rules">{
<span class="rule"><span class="attribute" style="color:rgb(181,137,0)">-ms-filter</span>:<span class="value"><span class="string" style="color:rgb(42,161,152)">"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"</span>;</span></span> <span class="comment" style="margin-bottom:0px!important; display:inline!important; vertical-align:top; color:rgb(88,110,117); font-style:italic">/* ie8 */</span>
<span class="rule"><span class="attribute" style="color:rgb(181,137,0)">filter</span>:<span class="value"><span class="function">alpha(opacity=<span class="number" style="color:rgb(42,161,152)">50</span>)</span>;</span></span> <span class="comment" style="margin-bottom:0px!important; display:inline!important; vertical-align:top; color:rgb(88,110,117); font-style:italic">/* ie5-7 */</span>
<span class="rule"><span class="attribute" style="color:rgb(181,137,0)">opacity</span>:<span class="value"> <span class="number" style="color:rgb(42,161,152)">0.5</span>;</span></span> <span class="comment" style="margin-bottom:0px!important; display:inline!important; vertical-align:top; color:rgb(88,110,117); font-style:italic">/* css standard, currently it works in most modern browsers */</span>
<span class="rule">}</span></span>


復(fù)制代碼
代碼如下:

<!DOCTYPE html>
<html>
<head>
<style>
img
{
opacity:0.4;
filter:alpha(opacity=40); /* For IE8 and earlier */
}
img:hover
{
opacity:1.0;
filter:alpha(opacity=100); /* For IE8 and earlier */
}
</style>
</head>
<body>
<h1>圖像透明度</h1>
<img src="/i/tulip_peach_blossom_w_s.jpg" alt="Peach Blossom" />
<p><b>注釋:</b>在 IE 中,必須添加 <!DOCTYPE>,這樣才能將 :hover 選擇器用于除了 <a> 之外的其它元素。</p>
</body>
</html>

相關(guān)文章

  • css之Display、Visibility、Opacity、rgba和z-index: -1的區(qū)別

    這篇文章主要介紹了css之Display、Visibility 和 Opacity 的區(qū)別,方便我們后期根據(jù)需要選擇,需要的朋友可以參考下
    2020-11-07
  • 詳解CSS-opacity子元素繼承父元素透明度的解決方法

    這篇文章主要介紹了詳解CSS-opacity子元素繼承父元素透明度的解決方法,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面
    2020-09-08
  • 詳解css透明度之rgba和opacity的區(qū)別及兼容

    對(duì)于設(shè)置透明度,我們有兩個(gè)可以選的css3屬性:rgba 和 opacity。這篇文章主要介紹了詳解css透明度之rgba和opacity的區(qū)別及兼容,感興趣的可以一起跟隨小編來(lái)了解一下
    2019-01-10
  • 舉例詳解CSS中的cursor屬性

    這篇文章主要舉例介紹了CSS中的cursor屬性,包括zoom-in/zoom-out和grab/grabbing等常用屬性值的使用,需要的朋友可以參考下
    2015-06-08
  • 詳解CSS中postion和opacity及cursor的特性

    background-postion接收多個(gè)值在瀏覽器中已經(jīng)兼容,我們可以用background-position來(lái)代替calc()函數(shù),從而去實(shí)現(xiàn)左方向或右方向的定位,這篇文章主要介紹了詳解CSS中postio
    2022-08-08

最新評(píng)論

安塞县| 高平市| 怀化市| 皮山县| 阿尔山市| 通榆县| 江山市| 南昌市| 木兰县| 太白县| 封丘县| 泽库县| 濮阳市| 林周县| 阳城县| 宜春市| 黄平县| 松阳县| 井冈山市| 庆城县| 敖汉旗| 宁国市| 蓬溪县| 布拖县| 兴义市| 施秉县| 济宁市| 五华县| 汝阳县| 新密市| 巴林右旗| 廉江市| 安徽省| 历史| 六枝特区| 石首市| 任丘市| 临泽县| 庐江县| 巩留县| 德兴市|