设置在ie7中工作的div的背景色的不透明度 [英] set opacity of background color of div that works in ie7

查看:48
本文介绍了设置在ie7中工作的div的背景色的不透明度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设置div背景的不透明度.意味着我想要div的透明背景.对于chrome&等浏览器来说,这非常简单firefox,因为支持rgba.

I want to set opacity of background of div. Means i want transparent background of div. It is very simple for browsers like chrome & firefox because rgba is supported.

但是对于ie7,我不知道该怎么做.过滤器:alpha(opacity = 50);"对我没有用,因为我想要透明的背景,而不是内容.

But for ie7, i don't know how to do that. "filter: alpha(opacity=50);" is not useful to me, because i want transparent background, not content.

我也不希望将透明图像设置为背景.

I also don't want transparent image to be set as background.

我也尝试了:: before并应用"filter:alpha(opacity = 50);",但是它在ie中也不起作用.

I have also tried ::before and apply "filter: alpha(opacity=50);", but it is also not working in ie.

谢谢.

推荐答案

为IE的背景使用透明图像.这很烦人,但这是做您想要的事情的最佳方法,而不会陷入文本的不透明性.或者只是对过滤器保持警惕 ...

Use a transparent image for the background for IE. It's annoying but it's the best way of doing what you want without getting stuck with opacity on the text. Or just go mental with the filters...

.opacityTest{
    /* Fallback for web browsers that doesn't support RGBa */
    background: rgb(0, 0, 0);
    /* RGBa with 0.6 opacity */
    background: rgba(0, 0, 0, 0.6);
    /* For IE 5.5 - 7*/
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);
    /* For IE 8*/
    -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";
}

这篇关于设置在ie7中工作的div的背景色的不透明度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆