...

View Full Version : Centering an image in HTML?



omfgandy
06-02-2009, 09:20 PM
I'm trying to create a button image in HTML. and I would like the the button to be 100 pixels left of the center and 150 pixels from the top. I need it to work with different resolutions.

This is what I tried which doesn't work.

<img src="Banner/edv_banner.png" style="position: absolute; topcenter; no-repeat; top: 113px; left: 50px;">

is this possible in HTML alone?

Apostropartheid
06-02-2009, 09:25 PM
From the top of...what, exactly?

BarrMan
06-02-2009, 09:25 PM
Try adding align="center" and then using additional css for the left:150px; using relative positioning.

masterofollies
06-02-2009, 09:25 PM
I am almost 100% sure it cannot be done in HTML. There is a CSS thing.

Try this


padding-left: 100px;
padding-top: 150px;

VIPStephan
06-02-2009, 09:27 PM
is this possible in HTML alone?

It is possible, but not if you write wrong code. What is this:


<img src="Banner/edv_banner.png" style="position: absolute; topcenter; no-repeat; top: 113px; left: 50px;"> :confused:

Please show us your entire code and maybe an image of how it should look like. Iím not psychic but I bet the banana Iím just eating that youíre kinda on the wrong path.

omfgandy
06-02-2009, 09:31 PM
Try adding align="center" and then using additional css for the left:150px; using relative positioning.

EDIT. nvm somthing messed up.



<html>
<head><title>East Digital Vikings</title></head>
<body background="Background/edv_tiledbackground.png">

<center>
<img src="Banner/edv_banner.png">
<img src="Background/edv_background.png">
<img src="Buttons/home.bmp" style="position:relative; top: 113px; left: -50px;">
</center>


</body>
</html>

somebody requested the code. because I might be on the wrong path.
I have never done HTML before.

coothead
06-02-2009, 10:56 PM
This solution...
http://www.htmlforums.com/showpost.php?p=702598&postcount=4
...seemed to satisfy our friend omfgandy. ;)

coothead



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum