Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 28th, 2006, 2:57 PM   #1
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 908
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
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.
titaniumdecoy is offline   Reply With Quote
Old Nov 28th, 2006, 3:22 PM   #2
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
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.
Arevos is offline   Reply With Quote
Old Nov 28th, 2006, 3:34 PM   #3
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Nov 29th, 2006, 9:42 PM   #4
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 908
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
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.
titaniumdecoy is offline   Reply With Quote
Old Nov 29th, 2006, 11:46 PM   #5
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Nov 30th, 2006, 12:35 AM   #6
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 908
Rep Power: 3 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
I tried adjusting the z-index attribute for both <div>s but that didn't seem to make any difference.
titaniumdecoy is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:27 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC