View Full Version : Center Webpage?
zacory03
08-31-2007, 08:21 PM
Im trying to center my homepage so its centered verticly and horrizontaly. I want it so you can view the navagation (the stars) in any web resolution so it would be good to center and center the whole page. Its not just an image, it has imagemaps and rollovers so i need it to center everything. If anyone could help! Thanks!
http://www.dreadedissues.110mb.com for preview
just view the source code and help me out please! =D
Medyman
08-31-2007, 08:25 PM
<html>
<head>
<title></title>
<style>
.absolute_center {
position:absolute;
width:723px; // width of your div
height:90px; // height of your div
top:50%;
left:50%;
margin-left:-361.5px; // width of your dive * -(1/2)
margin-top:-45px; // height of your div * -(1/2)
}
</style>
</head>
<body>
<div class="absolute_center">
MENU CODE
</div>
</body>
</html>
Also add that image as a background image instead of a regular image (to prevent horizontal scrolling).
zacory03
08-31-2007, 09:09 PM
uh thanks but i cant put the image as a background image because it has image maps and rollovers in it. thats kinda the problem
zacory03
08-31-2007, 09:13 PM
but i guess its alright. the code works fine and does what i pretty much wanted it too. Thanks.
zacory03
08-31-2007, 09:20 PM
oh wait, i have one question. its taking it off from only the bottom, and i need it centered horizontily, and not just taken off of the bottom? if that makes sence. thanks.
zacory03
08-31-2007, 10:27 PM
NVM NVM i figured it out, i just had to take away your "// width of your div" and such and now it works, THANK YOU SO MUCH, you dont know how happy and how long ive been trying to figure this out!
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.