CSS如何定位背景和使其透明 [英] CSS how to target background and make it transparent

查看:422
本文介绍了CSS如何定位背景和使其透明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用IE6和唯一的占有的东西,我可以工作的是 opacity:0.5; filter:alpha(opacity = 50);

  background-color:black; 
opacity:0.5;
filter:alpha(opacity = 50);

这可行,但它使文本透明以及如何只使背景颜色透明


解决方案

很简单,只有你能给予

  background:rgba(0,0,0,0.5)

for IE use this filter

  {background:transparent; -ms-filter:progid:DXImageTransform.Microsoft.gradient(startColorstr = #7F000000,endColorstr =#7F000000); / * IE8 * / filter:progid:DXImageTransform.Microsoft.gradient(startColorstr =#7F000000,endColorstr =#7F000000); / * IE6& 7 * / zoom:1;} 

更多关于颜色透明度的IE你必须阅读关于hsla color:
http://greenevillage.net/csspages/hsla.aspx p>

I am using IE6 and the only occupicy thing i can thing that works is opacity: 0.5; filter: alpha(opacity = 50);

background-color:black;
     opacity: 0.5;
     filter: alpha(opacity = 50);

this works but it makes the text transparent as well how can I make only the background colour transparent

解决方案

it's simple only you have do is to give

background: rgba(0,0,0,0.5)

& for IE use this filter

{background: transparent;-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#7F000000,endColorstr=#7F000000)"; /* IE8 */    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#7F000000,endColorstr=#7F000000);   /* IE6 & 7 */      zoom: 1;}

for more about color transparency in IE you have to read about hsla color: http://greenevillage.net/csspages/hsla.aspx

这篇关于CSS如何定位背景和使其透明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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