开发者

Can't make div background transparent

I'm helping a friend with this site:

http://smashingdivas.info/

No matter what style I apply to the gray background of the content div, I can't make it transparent (in any browser), so that the background image of the page shows through.

I've tried all of the following:

background-color: transparent;
background: transparent;
background-color: none;
background: none;

and nothing seems to work.

Thanks for yo开发者_开发百科ur help!


If it's the div with class 'container' it's because you have a rule in your HTML that is overwriting your CSS:

.container, .sliderGallery { background-color: #111111; }


If you want to apply transparency just on the background there are 2 options:

1) you can set the "alpha" channel on RGB ie.

background:rgba(255,255,255,0.5)

but this won't work on IE

2) create a simple transparent png image and set it this way

background:url(transparentIMG.png) repeat;


Have you tried applying the opacity property ? like for eg.

opacity:0.5;


Works for me, at least. I guess you're overriding the background properties via CSS due to some later rule again.


Just remove following rule:

.container, .sliderGallery { background-color: #111111; }

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜