View Full Version : image center


soundasleep
05-30-2003, 11:18 PM
i know this has been asked, but i looked and i think it might be because i'm doing something stupid. but, my picture won't center.


<DIV id="one_day" style="position: absolute; top:425px; left: 0px;" align="center">
<img src = "heroday.jpg" align="center" width="800" height="100" alt="one day"></div>

why won't the center in div or img work? is it because i put it as absoltue positioning? can i change that and still have the picture 425 px down from the top?

or if i put it in <center></center> tags, it won't work either. grr

Arc Angel
05-30-2003, 11:34 PM
Try taking out the left: 0px; and it should work. :)

zangerbanger
05-31-2003, 12:14 AM
Instead of putting your image in a div layer, you can position the image right within the image tags. Try this:

<img src="URL" style="position:absolute; top:#px; left:#px; z-index:#;">

Be sure to substitute your own information.

soundasleep
05-31-2003, 04:39 PM
if i take out the left px, it still doesn't work. also, if i do it the other way, then won't the placing be distorted if another window size is used? because i figured out the number of px i needed to center it on my window, but when i changed to a different size, it moved it farther to the right and messed it up. i would like it to be centered in any window size people use.

YellowYoshi
05-31-2003, 04:53 PM
Then you can do this:

<img src = "heroday.jpg" align="center" width="800" height="100" alt="one day" style="position:absolute; top:425px;">