Fixed Width Centered Website

Posted by Lindsayanng on March 20th, 2009

Want 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

VN:F [1.9.3_1094]
Rating: -9 (from 13 votes)

Want to know who is offering this awesome content? Here it is! Someone who is relatively new to web design. I am new enough to still remember how absolutely frustrating it was to try and get anything done in this field, but have also been around long enough to be able to help those that are where I was a year ago. Aside from web design, I run the office of my dad's engineering business, and do book keeping by trade. I love my pets.. All 6 cats, 1 peg legged dogs, and 1 hedgehog. LOVE THEM!! Oh yea, and my husband. He lets me chase my dreams and I let him do the same. We are happy people because of it. Read more from this author


Tags: ,

Comments are closed.

Bad Behavior has blocked 462 access attempts in the last 7 days.