設定半透明的元素

來源:互聯網
上載者:User
這次給大家帶來設定半透明的元素,設定半透明元素的注意事項有哪些,下面就是實戰案例,一起來看一下。

.opacity{ filter:alpha(opacity=50);
/* IE */ -moz-opacity:0.5;
/* 老版Mozilla */ -khtml-opacity:0.5;
/* 老版Safari */ opacity: 0.5;
/* 支援opacity的瀏覽器*/}

用 來設定一個元素為半透明

.filter = "alpha(opacity=" + opacity + ")";    /* IE */ .MozOpacity = (opacity / 100);                 /* 老版Mozilla */ .KhtmlOpacity = (opacity / 100);               /* 老版Safari */ .opacity = (opacity / 100);                    /* 支援opacity的瀏覽器*/

在Windows平台上縮放圖片,可能出現映像失真現象,可用IE的專有命令:

img{-ms-interpolation-mode: bicubic;}

相信看了本文案例你已經掌握了方法,更多精彩請關注php中文網其它相關文章!

推薦閱讀:

html+css中的四種隱藏方式

linear-gradient的使用詳解

css樣式中的border-image使用詳解

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.