View Full Version : centered background image


udesigns
05-11-2003, 08:24 PM
I have a layout graohic for my website, that needs to be as a background, but in the middly of the page, or it needs to be an absolute position image, but i cant make it centered. when i just center it the normal way, it has a big gap at the top, if i do it any other way, its all over the place! help O.o

SSPrincess
05-11-2003, 08:43 PM
Try making the picture bigger or having a background color so that whatever the picture doesn't cover, it'll show up in that color.

Does this help you?

Oh, and welcome to LEIA Forum!

zangerbanger
05-11-2003, 11:31 PM
Align your image using percentages and it will be dead center. Like this:

<div style="position:absolute; top:50%; left:50%;z-index:1;">YOUR IMAGE HERE</div>

udesigns
05-12-2003, 03:26 AM
i did that, and it worked, but now i an't position my iframe on top of the image, any idea how to get it so it overlaps? i tried another div layer, but it didnt work. this is the code i have so far:

<html>
<title>Undecided Designs</title><head>
<link rel="stylesheet" href="C:\my documents\style.css" type="text/css">
</head>
<body bgcolor="#333333">
<div style="position:absolute; top:0%; left:25%;z-index:1;"><IMG SRC="C:\my documents\my pictures\layouts\hfftb\grey\grey2.gif"></div>
</body>
</html>

and im trying to fit the ifame over a section of the image.