![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Expert Programmer
|
Transparent Background
Hi,
I'm looking for a way to make the background only of a <div> semi-transparent. I have searched around but have been unable to find a solution that works consistently across browsers. Does anyone know of a way to achieve this in most, if not all, modern browsers? Thanks. |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
IE7.js is a javascript library that automatically works around many of the bugs in IE5 and 6. IIRC, it gives IE support for transparent png backgrounds.
|
|
|
|
|
|
#3 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
If you're talking about opacity, as seen in the menu shadow here, IE 6 uses a different style specification than Firefox.
Firefox: opacity: .5; IE: filter: alpha(opacity=50); I have no idea what IE7 does. I've installed it, but not checked my sites against it.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#4 |
|
Expert Programmer
|
DaWei: I applied that style to a <div> and it worked, but the text inside was semi-transparent as well. And surrounding the text in a second <div> with higher opacity made no difference.
The solution I have come up with is to use a png file with 1px transparent "holes". So far I haven't had time to look at IE7.js. |
|
|
|
|
|
#5 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Put your text in another div at a different level.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#6 |
|
Expert Programmer
|
I tried adjusting the z-index attribute for both <div>s but that didn't seem to make any difference.
![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| pause \ stop background worker | john Wesley | Visual Basic .NET | 1 | Aug 21st, 2006 9:31 AM |
| background images | boz | Java | 0 | Sep 11th, 2005 6:02 PM |
| Neat little program... | Sane | Python | 3 | Apr 10th, 2005 6:49 PM |
| Transparent Image? | jorgen_i | C++ | 1 | Mar 7th, 2005 12:58 PM |
| Printing rich text with colored background | jarrod | C# | 1 | Feb 23rd, 2005 12:48 PM |