CSS透明背景時,記得給容器加上寬!

來源:互聯網
上載者:User

在項目中用到的透明效果,除了用PNG24圖片外就是用如下樣式了:

filter:alpha(opacity=70);       /* IE */ 
-moz-opacity:0.7;             /*  Moz + FF */
opacity: 0.7;          /* 支援CSS3的瀏覽器(FF 3.6也支援)*/
今天卻用傻了,居然IE不透明了,相關代碼如下:

.mes_show{

background:#EBEBEB;position:relative;margin-top:-60px;padding:1px;

filter:alpha(opacity=70);       /* IE */ 
-moz-opacity:0.7;             /*  Moz + FF */
opacity: 0.7;          /* 支援CSS3的瀏覽器(FF 3.6也支援)*/

}

在IE下不透明,FF上透明?百思不得其解.

晚上終於查出原由~因為我父層定了寬,裡面這個層自然我就不會再寫一遍啦!結果問題就出在這.給其加個寬就行了.(另外不加寬加個絕對位置也行哦!)

哦買嘎得!差點發現新大陸了

相關文章

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.