td valign command?

liunx

Guest
I have created an image, but do not know how to align the image in the middle of the page not the top center.<br />
<br />
The command td align=center will place the image in the center of the page but at the top of the page also.<br />
<br />
How can i get the image to be excatly in the centre of the web page?<br />
<br />
Is it something to do with td valign=middle?<br />
<br />
Hope someone can help me?<br />
<br />
:-)<!--content-->You need to use CSS. Try looking at <!-- m --><a class="postlink" href="http://www.infinitypages.com/research/cssverticalcentereddiv.htm">http://www.infinitypages.com/research/c ... reddiv.htm</a><!-- m --><!--content--><!-- Put this within the IMG tag --><br />
<br />
<img style="position: absolute; left: 50%; top: 50%;" src=http://www.webdeveloper.com/forum/archive/index.php/"your image.whatever"><!--content-->That won't work. That will position the top, left corner of the image in the middle of the screen. If you want to see how to center an element on your page, look at <!-- m --><a class="postlink" href="http://www.infinitypages.com/research/cssverticalcentereddiv.htm">http://www.infinitypages.com/research/c ... reddiv.htm</a><!-- m --><!--content-->showoff... :) <br />
<br />
I would have gotten it right but I didn't know you could put the "top" and "left" commands in the style command... lol... Doesn't the margin scrunch the image that is in there too if it is too small for the image, and why are the margins nevagive?<!--content-->The margins are negative to offset the top and left by the amount specified. When you set it to half your width and height, you get the center of you element right on the center of the page.<!--content-->
 
Back
Top