Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Old 02-24-2006, 10:24 PM Background opacity?
Junior Talker

Posts: 4
Trades: 0
Is there any way that you can apply opacity properties to a background url in your css and have those attributes consitent to your bg img alone?

eg:
#bg {background: url(blah.jpg) top left no-repeat; opacity:0.5;} (or something to that affect)

The probem is, it always affects the child (insert lame pun here). I need the parent to have an opaque bg with an expanding child (ie. addition of text and imgs) without being effected by the parent opacity properties (ie. text and img don't come out translucent).

i've been here: Mandarin Design
and this site offers and interesting alternative: Spiral Demo
and here is a couple of my own experiments: test

What i really want is to be able to set opacity to a bg img exclusively. I've tried pseudo classes (first-child elements), tampering with css, tampering with inline spans and i can't get anything to work.
My guess is, opacity is only a new creation and either nobody has any idea yet ar the program itself hasn't developed that far yet- am i wrong???
Any idea's greatly appreciated.

McGuffog.

Last edited by benjo; 02-24-2006 at 10:50 PM..
benjo is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-25-2006, 12:59 AM Re: Background opacity?
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
I think at the moment it's always going to affect the children. I've had the same issues and haven't used opacity as much as I would like bcause of it. Hopefully in time we'll have a little more control with it.

For now though we have to wait.

Thanks for the links by the way. I've seen the spiral before, but the other was new to me as was your test naturally. Other than opacity I'm waiting on IE to catch up and allow for border-radius. It might be in IE7, but it'lll be awhle before IE6 goes out of fashion anyway.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 03-01-2006, 05:34 PM Re: Background opacity?
jet
Junior Talker

Posts: 1
Trades: 0
Hi, a while ago I played with transparency and scaling: http://www.oplijn.nl/proef/beeldschalen/schalen.html
You won't need to read this language, you can read the sourcecode.
jet is offline
Reply With Quote
View Public Profile
 
Old 05-12-2008, 09:20 AM Re: Background opacity?
Junior Talker

Posts: 1
Name: Jade
Trades: 0
This may be a bit late, 2 years too late... however, for anyone who stumbles on this forum thread as I did, this might be helpful.

You could always use an opac image as the background, like a .PNG
Jadelina is offline
Reply With Quote
View Public Profile
 
Old 05-12-2008, 04:19 PM Re: Background opacity?
Skilled Talker

Posts: 59
Name: Dan
Trades: 0
Quote:
Originally Posted by Jadelina View Post
This may be a bit late, 2 years too late... however, for anyone who stumbles on this forum thread as I did, this might be helpful.

You could always use an opac image as the background, like a .PNG
The problem with using a transparent .png is that IE struggles if you try to do anything clever over the top. Try using a lightbox effect or expanding div with moo or something similar when you have transparent .png on the page and you'll see what I mean, you'll get an incredibly jerky animation.

The best workaround I've found in this situation is to use custom style sheets for IE which use pseudo opacity with a transparent gif, whereby you make every other pixel transparent in a block of colour. It's a hassle, it doesn't look nearly as good as proper png opacity, and can only really be used if you want a semi transparent single colour background but it can be better than nothing if the design really requires a semi transparent element.
__________________

Please login or register to view this content. Registration is FREE

Nuts to that I just want to
Please login or register to view this content. Registration is FREE
Monkey Do is offline
Reply With Quote
View Public Profile
 
Old 05-17-2008, 11:07 AM Re: Background opacity?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
I used to grumble about this problem, but then realized that opacity affecting all of the children is actually quite convenient. It allows us to do some neat fade in/fade out effects on entire elements in Javascript. Don't count on the spec being changed any time soon! This does have the affect of not allowing easy opaque backgrounds using CSS, but as pointed out, a simple .png can be used (in modern browsers).

It is not a good idea to use large swaths of CSS opacity across a browser anyway, as it has a poor affect on runtime speed, especially in Firefox. If you are going to be using dynamic effects on your webpage, especially anything involving animation, it is best to avoid too much opacity, even if it makes things prettier.
__________________
Join me on
Please login or register to view this content. Registration is FREE

Last edited by wayfarer07; 05-17-2008 at 11:10 AM..
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 05-18-2008, 03:39 PM Re: Background opacity?
Super Talker

Posts: 107
Name: Sandy
Trades: 0
benjo,

I have no idea if this page and the HTML/CSS will help you but this is from a class I took:

http://www.sandysdesignline.com/webb.../wk6final.html

I hope it helps.
__________________
Sandy K
sandyk3 is offline
Reply With Quote
View Public Profile
 
Old 05-18-2008, 06:27 PM Re: Background opacity?
Gilligan's Avatar
Website Designer

Posts: 1,670
Name: Stefan
Location: London, UK
Trades: 0
It's not every day that a 2 year old buried thread is dug up :eek
__________________

Please login or register to view this content. Registration is FREE
Gilligan is offline
Reply With Quote
View Public Profile
 
Old 05-21-2008, 05:54 PM Re: Background opacity?
Average Talker

Posts: 21
Name: Mitch
Trades: 0
As pointed out below, and now tested by me. The method I had posted here does not actually work.

Thank you vangogh.
__________________
-Mitch

Please login or register to view this content. Registration is FREE

Portfolio:
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Last edited by Mviner04; 05-22-2008 at 11:30 AM.. Reason: Inaccurate information
Mviner04 is offline
Reply With Quote
View Public Profile
 
Old 05-21-2008, 06:51 PM Re: Background opacity?
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Mitch I don't think that works, though don't hold me to that if it does. I think once you've set an opacity on the parent you can't override that opacity in the children.

With the code you have the children will still have an opacity of 0.5 assigned to them even though you're specifically applying an opacity of 1.0 to the child elements.

I wish you could do things as you mention. It would make css transparency more useful in my opinion.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Reply     « Reply to Background opacity?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.53399 seconds with 12 queries