opacities

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
HiddenS3crets
Forum Contributor
Posts: 119
Joined: Fri Apr 22, 2005 12:23 pm
Location: USA

opacities

Post by HiddenS3crets »

~pickle | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


If I have a main div box that is set to an opacity < 1.0, is there a way to make an inner div tag have an opacity of 1.0?

Currently anything inside the main div (the one with the low opacity) shares the same opacity. I want to display an image inside the dimmer box, but the image is also dimmed. Any way to make it opacity 1.0?

Code: Select all

<div id='main'>
this box is set to a low opacity
  <div id='image'>
  <!-- the image is at the same opacity as id='main', I want it to have a 1.0 opacity -->
  </div>
</div>

~pickle | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: opacities

Post by califdon »

I'm not certain, but it would seem logical that if the containing Div has a low opacity, that's going to apply to everything it contains. You might try moving the image outside the low-opacity Div and using Positioning to locate it "over" the dimmer background.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: opacities

Post by pickle »

Sorry - can't be done. ~califdon is right - child elements automatically get the opacity setting of the parents & cannot be any more opaque (less transparent) than the parent.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply