• Making an image in the "X" center of the screen.
    8 replies, posted
This is something that I've been trying to look up but can't find an answer to. Does anybody know how to make an image or table, not background, into the center of the screen, no matter how large their resolution is?
Umm would padding: 50%; work or something?
[code]<style type="text/css"> .centered { width: 50%; height: 50%; margin: 0 auto; } </style> <DIV class="centered"> <img src="http://i70.photobucket.com/albums/i104/HALO_360/Computer_Temp_Idle.png" border="0" alt="Photobucket"></a> </DIV>[/code] [editline]11:08AM[/editline] That's the quick code I made it but it doesn't work. [editline]11:09AM[/editline] I want the table/image in the center of the page. Vertically and horizontally.
Lots of <br>'s :D
Never use <br />s, you need to use padding, and noth width. Something like this should work [html] <div style="width: 100%; height: 100%; padding: 50%;"> <img src="image.png"> </div> [/html] Untested.
Doesn't work. It makes the image all the way down on the page. Like, you'll have to scroll down to see the image.
This might help you. [url]http://www.pmob.co.uk/pob/hoz-vert-center.htm[/url]
[QUOTE=JDream;19273415]This might help you. [url]http://www.pmob.co.uk/pob/hoz-vert-center.htm[/url][/QUOTE] Awesome, just f'n awesome. It's what I been looking for a very long time. Thanks.
use the negative margin technique
Sorry, you need to Log In to post a reply to this thread.