Page 1 of 1

opacities

Posted: Thu Feb 28, 2008 7:07 pm
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]

Re: opacities

Posted: Thu Feb 28, 2008 10:56 pm
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.

Re: opacities

Posted: Fri Feb 29, 2008 11:09 am
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.