473,387 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

is it possible: transparent background color for div?

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
4 3903
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Paul Schnitter | last post by:
Update: My custom control is based on the article "Creating Visual Basic .NET controls from scratch" in "Adventures in .NET" on MSDN. It is designed to be a replacement for the VB6 shape...
7
by: Thomas Wieser | last post by:
Hi, my problem: I have some tables with transparent backgrounds, which are changed in colours within a JavaScript DOM function to have a roll-over effect. Now, i can't get them back...
1
by: Efkas | last post by:
My application have some level : 1. MyButton class with Label inheritance 2. MyComponent as User Control loading and positionning some of MyButtons 3. MyApp loading and positionning MyComponent ...
5
by: Mark Deibert | last post by:
I'm a former VB6 coder. Quit a few years ago. Now I'm back and trying to teach myself VB.NET. I don't remember having this much difficulty learning VB6. I'm totally stuck on something and need your...
4
by: jcrouse | last post by:
I am using the following code to move a label on a form at runtime: If myMousedown = lblP1JoyRight.Name Then If lblP1JoyRight.BackColor.Equals(Color.Transparent) Then bTransCk = True ...
2
by: Dean Slindee | last post by:
It appears that I have two routines that don't play well together! First routine: a form's background is shaded with a gradient color. Second routine: then, the background of all labels on the...
9
by: Rhino | last post by:
I've been updating some CSS today and got one odd error from the validator at http://jigsaw.w3.org/css-validator/. Every time I had 'background: transparent;' (or background-color: transparent;)...
1
by: =?Utf-8?B?Um9nZWxpbw==?= | last post by:
hey, I have an MDI form here, and I let the user choose the background color of the MDI parent. but they cant choose transparent!. is it possible to make the background transparent somehow? I am...
8
by: Brian Ward | last post by:
I am looking for a simple way to set the image transparency in a PictureBox. I have a moving PictureBox containing a graphic image .. moving by incrementing its Left property. The background...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.