...

View Full Version : z-index and image problem



rasafrasit
08-11-2005, 10:15 PM
I am trying to get one layer with text to display over another which has an image. It works fine when the image is placed as a background using the class definition but not when it is placed via <img src=... I need to be able to control the image in the code rather than the stylesheet. Am I missing something basic? Here is a snip of the relevant code:

#frame_title
{
height: 20px;
display: block;
z-index: 105;
color: black;
}

#frame_content
{
height: 347px;
display: block;
margin-top: -20px;
z-index: 101;
}

...

<div id=frame>
...

<div id=frame_title>
TEST TITLE
</div>

<div id=frame_content>
<img src="clock_5.gif">
</div>

</div>

mcdougals4all
08-11-2005, 10:22 PM
For the z-index to apply properly to a particular element you also need to set a value for the position attribute. Depending on the rest of your layout, you probably want to experiment with position:relative; or position:absolute;.

This is a better link: http://brainjar.com/css/positioning/

rasafrasit
08-11-2005, 10:24 PM
roger that, thanks, I'll give it a shot

rasafrasit
08-11-2005, 10:26 PM
that did it, thanks, I had a feeling it was something simple



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum