Background Opacity without affecting Text

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.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Aug 30th, 2007, 14:25
Up'n'Coming Member
Join Date: Nov 2006
Location: Ipswich
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Background Opacity without affecting Text

If you use the following code to apply an opacity to the background-colour of a box...

Code: Select all
#somediv {
background-color:#000;
filter:alpha(opacity=50);-moz-opacity:.50;opacity:.50;
}

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!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Aug 30th, 2007, 14:27
Daniel's Avatar
Elite Veteran
Join Date: Sep 2006
Location: The Kingdom of Rabbits
Age: 21
Posts: 2,051
Blog Entries: 12
Thanks: 0
Thanked 0 Times in 0 Posts
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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Aug 30th, 2007, 14:32
Up'n'Coming Member
Join Date: Nov 2006
Location: Ipswich
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Background Opacity without affecting Text

if my text div if nested in the opaque div, it doesn't seem to make any difference.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Aug 30th, 2007, 15:46
Elite Veteran
Join Date: Aug 2005
Location: That Place
Posts: 2,044
Blog Entries: 1
Thanks: 0
Thanked 37 Times in 37 Posts
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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Aug 30th, 2007, 15:51
Most Reputable Member
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Aug 30th, 2007, 15:57
Up'n'Coming Member
Join Date: Nov 2006
Location: Ipswich
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Aug 30th, 2007, 16:32
Most Reputable Member
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Aug 30th, 2007, 20:22
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Background Opacity without affecting Text

Is this the one you mean Pete? http://homepage.ntlworld.com/bobosola/

This is a javascript solution...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Aug 30th, 2007, 21:05
Most Reputable Member
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Aug 31st, 2007, 11:36
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Aug 31st, 2007, 11:38
Up'n'Coming Member
Join Date: Nov 2006
Location: Ipswich
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Background Opacity without affecting Text

Thanks for your efforts Pete. And glad my failings could be of some assistance to you Lchad!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Aug 31st, 2007, 14:11
Most Reputable Member
Join Date: May 2006
Location: North West, UK
Age: 22
Posts: 1,173
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Background Opacity without affecting Text

Doesn't work with CSS background images apparently.

Oh no!

Pete.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
css, opacity, text

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 10:46.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42