Log in

View Full Version : Transparent over table



remus
11-16-2008, 10:28 AM
Okay, this is probably a very simply code, but I cant seem to nail it D:

I have an image that is half transparent, and I want the transparent area to overlap with a html table, so that both the small part of the image that is in the transparency and the table are both visible in the same field. I tried to use the absolute function with divs but I can't seem to find the right combination.

Anyone?

BLiZZaRD
11-16-2008, 04:44 PM
Z-index. negative margins. And you don't want absolute positioning. 2 absolutes make an absolutely wrong. :) Try relative

remus
11-17-2008, 01:07 AM
Thanks! I tried that and it worked just fine, but it seems that the space I'm trying to put it into (I'm designing a layout) is a html only space, so it seems to be ignoring the CSS coding. :confused: Is there any plain html version of the z-index?

Medyman
11-17-2008, 01:27 AM
Use inline styles.

<div style='z-index:999;'>This is on top of everything</div>


2 absolutes make an absolutely wrong.
:) I like that.

remus
11-17-2008, 02:08 AM
Sadly, that doesnt seem to be working either. Or possibly I have it placed in the wrong place, but I dunno. I tried to make the graphic z-index:999 just by itself, and nothing changed, and then I tried to make the graphic z-index:999 and the table z-index:-1 or something and nothing changed.

Medyman
11-17-2008, 01:45 PM
z-index by itself doesn't do anything. I should have provided a more complete example. Sorry. Z-index only works with elements that have are either relatively or absolutely positioned.

So, try this:

<div style='z-index:999;position:relative'>This is on top of everything</div>