[Solved] z-index confusion

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Locked
izzysanime

[Solved] z-index confusion

Post by izzysanime »

Hi,

Some times I get the z-index working and some times I do not.  What am i doing wrong? ^_^

Code: Select all

.thrColEls #mainHome {
	margin-left: 24px;
	margin-right: 20px;
	margin-top: -7px;
	background-repeat: no-repeat;
        z-index: 0;
}
}
#1 {
        z-index: 2;
}
The #1 image is still behind the mainHome image.

Thanks,
Josh
Last edited by izzysanime on Fri Aug 15, 2008 7:49 am, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: z-index confusion

Post by Dr.CSS »

You have one too many }...

.thrColEls #mainHome {
margin-left: 24px;
margin-right: 20px;
margin-top: -7px;
background-repeat: no-repeat;
        z-index: 0;
}
}
#1 {
        z-index: 2;
}
izzysanime

Re: z-index confusion

Post by izzysanime »

o, woops.  thanks.  I also added

Code: Select all

position: relative;
earlier and that worked, but thanks for noticing the extra }
Locked

Return to “Layout and Design (CSS & HTML)”