This is a discussion on "Background Opacity without affecting Text" within the Web Page Design section. This forum, and the thread "Background Opacity without affecting Text are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Background Opacity without affecting Text
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Background Opacity without affecting Text
If you use the following code to apply an opacity to the background-colour of a box...
how do you prevent any text within that div being opacitised (i don't know if that's a word, it's a tricky verb!) ta! |
|
|
|
#2
|
||||
|
||||
|
Re: Background Opacity without affecting Text
Do it in 2 seperate divs? making the background Opaque while the test not opaquized
Last Blog Entry: Assassin's Creed (Nov 22nd, 2007)
|
|
#3
|
|||
|
|||
|
Re: Background Opacity without affecting Text
if my text div if nested in the opaque div, it doesn't seem to make any difference.
|
|
#4
|
|||
|
|||
|
Re: Background Opacity without affecting Text
You could just make a small graphic file with the light color or whatever and use that. or perhaps set a different opacity for the p tags etc. I never tried but that may work.
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
|
|
#5
|
|||
|
|||
|
Re: Background Opacity without affecting Text
I just tried setting the opacity on text and it doesn't seem to work. Changing the colour of the text makes it visible (depending on the colour you choose) but it doesn't solve the opacity problem.
I'll see if I can come up with anything. Pete. |
|
#6
|
|||
|
|||
|
Re: Background Opacity without affecting Text
Cheers Pete
I tried setting the Opacity to 2.0 (as in my head this theoretically would cancel out the 0.5 opacity) with a p class. Alas it didn't work. It's like there need to be a setting that ignores opacity or "switches it off" when the parent is opaque but the child doesn't want to be! |
|
#7
|
|||
|
|||
|
Re: Background Opacity without affecting Text
OK, as far as I'm aware, there is no solutions to this. I have tried everything I can think of, read through loads of forum posts and articles and it seems that the opacity rule applies itself to every child element. There doesn't seem to be any way of counteracting this.
My advice would be to use a transparent png with it's opacity set at the desired level. And then use this as a bg in your css. Not ideal but the best you'll get at the minute. PNG support will be easier to tackle than this opacity problem. Does anyone have the link for that 'transparent PNG fixer' for IE? Pete. |
|
#8
|
|||
|
|||
|
Re: Background Opacity without affecting Text
Is this the one you mean Pete? http://homepage.ntlworld.com/bobosola/
This is a javascript solution... |
|
#9
|
|||
|
|||
|
Re: Background Opacity without affecting Text
Yeah that's the one, I was looking for it myself and couldn't find it...
I've never used it myself but I assume it works. I'll try it though cos I want to use transparent PNGs myself at the minute. Cheers, Pete. |
|
#10
|
|||
|
|||
|
Re: Background Opacity without affecting Text
This thread came up at the perfect time for me as well. I'm going to play with this for a new client design.
|
|
#11
|
|||
|
|||
|
Re: Background Opacity without affecting Text
Thanks for your efforts Pete. And glad my failings could be of some assistance to you Lchad!
|
|
#12
|
|||
|
|||
|
Re: Background Opacity without affecting Text
Doesn't work with CSS background images apparently.
Oh no! Pete. |
![]() |
| Tags |
| css, opacity, text |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Image with text -> text with background | alexgeek | Web Page Design | 5 | Nov 13th, 2007 23:25 |
| scroll does not line up text and background | cherishkiss | Web Page Design | 2 | Feb 22nd, 2007 15:40 |
| center align text/background image | Lchad | Web Page Design | 5 | Dec 5th, 2006 10:40 |
| Text div overlapping background | csa | Web Page Design | 2 | Aug 9th, 2006 12:09 |
| Building Text/Dropdown Menu w/ no background | TruBluTex | Flash & Multimedia Forum | 8 | Jan 15th, 2006 20:54 |