By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,462 Members | 799 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,462 IT Pros & Developers. It's quick & easy.

is it possible: transparent background color for div?

P: n/a
Hello,

I have two div's, div1 is a lot bigger and is the parent of div2, and div1
also has a background image.

What I would like to do, is set a background color for the smaller nested
div2, but at the same time it is transparent and the background image of
div1 shines through. I hope my explanation is a bit clear.

Is this kind of effect at all possible, without using a background image for
div2 with alpha channel?

thanks,

CHris
Oct 20 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Chris schrieb:
I have two div's, div1 is a lot bigger and is the parent of div2, and div1
also has a background image.

What I would like to do, is set a background color for the smaller nested
div2, but at the same time it is transparent and the background image of
div1 shines through. I hope my explanation is a bit clear.
I don't think the specs forbid it. Did you try it?
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Oct 20 '06 #2

P: n/a
On 2006-10-20, Chris <kr*******@hotmail.comwrote:
Hello,

I have two div's, div1 is a lot bigger and is the parent of div2, and div1
also has a background image.

What I would like to do, is set a background color for the smaller nested
div2, but at the same time it is transparent and the background image of
div1 shines through. I hope my explanation is a bit clear.

Is this kind of effect at all possible, without using a background image for
div2 with alpha channel?
You can use the opacity property on div2.

opacity: 0.8;

for example.

It's in CSS3, not 2.1, but is fairly widely supported.
Oct 20 '06 #3

P: n/a
Chris <kr*******@hotmail.comwrote:
>I have two div's, div1 is a lot bigger and is the parent of div2, and div1
also has a background image.

What I would like to do, is set a background color for the smaller nested
div2, but at the same time it is transparent and the background image of
div1 shines through.
Two background images in overlapping elements? Sounds dodgy. A URL would
have allowed us to see what you are actually trying to do, but as per
usual no URL is supplied.
>I hope my explanation is a bit clear.
About on par with the opacity of mud.
>Is this kind of effect at all possible, without using a background image for
div2 with alpha channel?
http://www.w3.org/TR/2001/WD-css3-co...5#transparency A CSS3
property which is supported sans vendor prefix by recent releases of
Opera and Mozilla. For IE there is the familiar filter:alpha method.

--
Spartanicus
Oct 20 '06 #4

P: n/a
Ben C wrote:
On 2006-10-20, Chris <kr*******@hotmail.comwrote:
>Hello,

I have two div's, div1 is a lot bigger and is the parent of div2, and
div1 also has a background image.

What I would like to do, is set a background color for the smaller nested
div2, but at the same time it is transparent and the background image of
div1 shines through. I hope my explanation is a bit clear.

Is this kind of effect at all possible, without using a background image
for div2 with alpha channel?

You can use the opacity property on div2.

opacity: 0.8;

for example.

It's in CSS3, not 2.1, but is fairly widely supported.
Wow, that's really fantastic. Thanks very much!

Chris
Oct 20 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.