Fixed Width Centered Website
Posted by Lindsayanng on March 20th, 2009Want to take your entire website and make it a fixed with and have it centered in the middle of everyone’s screen? Well, you should. The great thing about having a fixed width and centered site is that it will look exactly the same on everyone’s computer monitor. It’s a great thing, because fluid websites that take up the entire width of a screen can look great on your monitor, and then you go look at it on a lower resolution monitor, and all of a suddent you have to scroll sideways to see all of it.
So this is going to be one of the EASIEST things that I will teach you, and it will change the look of your website GREATLY. This works on ALL TYPES of websites. Blogs, oscommerce, basic HTML. It does not matter.
do this..
AT THE VERY BEGINING of your HTML code, after theĀ <body> tag, add this:
<div id="centerContent">
YOUR WEBSITE CONTENT WILL ALL
BE BETWEEN THESE TWO THINGS.
EVERY SINGLE BIT OF IT – EXCEPT
OF COARSE THE STUFF IN THE HEAD
TAGS
</div>
then in somewhere between the <head></head> tags, add this:
<style>
#centerContent{
width: 900; margin: auto;
border: 1px solid #999999;
text-align:center;
}
</style>
then on the <body> tag change it to this
<body text-align="center">
Thanks to the boring lives of obnoxious internet stalkers and their friends, this post has comments closed. 1 year to stalk a post is way too much time. Please, get a life
Tags: center site, center website
