Treehouse: Grow your CSS skills. Land your dream job.

Trouble with Layering CSS divs

  • # November 22, 2010 at 2:32 pm

    Hey everyone. I really need some help layering some divs. I have the z-index property set, but it seems to be being ignored….

    #sideimg {width: 264px; height: 100%; background-image:url(images/side.png); background-repeat:repeat-y; position:absolute; top: 0; left: 0; z-index:3;}

    #logo {background-image:url(images/logo.png); background-repeat:no-repeat; z-index:10; position: absolute; top: 0; left: 5px; width: 221px; height: 168px;}

    The sideimg should be behind the logo, but its not working unless I take the z-index property from the sideimg….which in turns moves it behind other images. Not sure where the problem is or what to do. Any help is appreciated.

    # November 22, 2010 at 2:55 pm

    Ok, I found the problem….feel kinda dumb now, but maybe this will help someone else. I had accidentally set the z-index property of the parent div on the logo and it was showing at that layered position instead of the one I set for it.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.