...

View Full Version : Resolved making 1 div appear over another?



LJackson
02-26-2009, 05:12 PM
Hi all,

i am struggling with my divs at the moment i have a small image and next to it some text but if the text happens to go behind the image it goes behind, how do i set it so that it goes infront of the image

see here (http://www.kernow-connect.com/Website/electronics.php) the amazon top item title is partly under the image.

here is my css for the two divs

.inditemheader {
font-size:14px;
height:30px;
width:178px;
float:left;
text-align:center;
margin-left:60px;
margin-bottom:15px;
z-index:2;

.indtopitemimg {
position:absolute;
width:70px;
height:50px;
float:left;
z-index:1;
}
}

i've tried changing the z-index around with no success, the inditemheader is the one i want on top.

cheers
Luke

Rowsdower!
02-26-2009, 05:33 PM
Hi there. Why not make that image the background of your "recommends" div like this:
.recommends{
background-image:url(../images/top.gif);
background-repeat:no-repeat;
border:1px solid #FF0000;
float:left;
font-family:Arial,Helvetica,sans-serif;
font-size:15px;
height:240px;
margin:5px 5px 5px 2px;
text-align:center;
width:291px;}

Then remove your image tag from the HTML? You could skip a div in the markup as well...

Is this what you're looking for?

LJackson
02-26-2009, 06:06 PM
cheers mate thats exactly what i wanted :)

thanks
Luke

bencharity
05-19-2009, 07:36 AM
Hello, I also want a div to appear over another, but I cannot use the background solution previously offered.

A test page is here: http://www.trinityvineyardworship.com/40-jason-upton-faith

You'll see a 'Slide In' link, I want that to slide in over the embedded pdf. I don't want the pdf to be down below.

Excuse my rudimentary sketch, but I hope it helps you visualize my end desire.

http://www.trinityvineyardworship.com/img018.jpg

Thanks in advance!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum