Re: Opaque DIV tags refusing to be Opaque
On 2008-02-28, Steve <tinker123@gmail.com> wrote:
> On Feb 28, 10:52 am, "Rik Wasmus" <luiheidsgoe...@hotmail.com>
>> Yes: absolute positioning, 2 containers (opaque element & container for
>> pop-in box), don't make the one with the pop-in box a descendant but
>> rather a sibling with both an apropriate z-index.
>
> Rik;
>
> I'm a noob still learning this stuff so I am not sure I understand
> what you wrote.
>
> Do you mean use 2 container divs, one containing the transparent
> underlay and one containing the message box, with the message box &
> underlay having the same z-index?
>
> It seems that if I have two divs, one under the other, that the top
> will become the parent. Can I neutralize that by setting the zindex
> in each to be the same?
You may not need to use z-index.
I posted an example of one way to do it earlier. But however you do do
it, the bottom line is to remember that you can never make an element
more opaque than its ancestors.
You could achieve the same effect using pngs with alpha of course--
those are just alphas, not recursive opacities. That might be easier.
Just make a 1x1 pixel semi-opaque png, tile that as the background image
on your overlay that's supposed to grey things out, and then put the
popin on top. Don't set opacity on anything.
|