Jump to content

DIV overlay overtop of identical DIV


xProteuSx

Recommended Posts

I have a div, like this:

 

div.article

{

float: left;

min-width: 310px;

min-height: 150px;

margin-left: 2px;

margin-right: 2px;

margin-top: 5px;

background-color: #9c9c9c;

border-style: solid;

border-width: 1px;

border-color: #000;

}

 

I would like to overlay another div, with identical dimensions.  This second div would contain an semi-transparent image, that would overlay the contents of the article div.  I have been trying to do this for so long, but I can't find anything that works.

 

z-index, I know, but it just won't work for me.  Help, please!!!

Link to comment
Share on other sites

well, what does the css for the other div look like atm?

Something like this should work:

 

div.other-div
{
    position: absolute;
    left: 2px;
    top: 5px;
    z-index: -1;
}

 

remember, the z-index property will only work on elements that are positioned.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.