View Full Version : Center content, vertically and horizontally?
01-23-2010, 05:12 AM
I'm looking for some script or some way of centering my content in the browser window both horizontally and vertically. I found one script which works, but the pages jump from the corner to the center each time they're loaded which is jarring to look at. Any thoughts? Thanks!
01-23-2010, 03:05 PM
I usually fix this by using the <center> tag and having the rest of my website in a 'div wrapper'. like this:
<div style="text-align: left;">
the code for my site goes here
hopefully this help you
01-23-2010, 03:07 PM
the div SHOULD be given the same width as your page for best results
01-23-2010, 03:13 PM
Thanks! But do you know how to center vertically as well?
01-23-2010, 03:19 PM
See this thread (http://www.dynamicdrive.com/forums/showthread.php?t=51817).
01-23-2010, 04:11 PM
Success! That did the trick. You have no idea how long it's taken me to find a solution to what seems like such a basic thing. Thanks!:)
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.