Design-CSS

A one stop site for your daily dose of CSS.
You will find a large collection of CSS and HTML related articles on our site

Happy Coding!!

All you wanted to know about centering your website

The first thing a web developer would do when he starts coding a website is center the layout. This is probably the most important thing to do and is also probably the easiest. This article will help you do just that.

A number of techniques are available, I will list the most common (and safest) one below.

Page wrapper.

Here you need to a assign the following properties to your wrapper,

				#page-wrap {
					width: 980px;
					margin: 0 auto;
				}
				

And that does it. The page width will be fixed to 980 pixels with equal right and left spacing.

To be on the safer side with the older versions of Internet Explorer, I would advise you to add the following to your css file,

				body {
					text-align: center;
				}
				

If your dealing with a fluid width system, the following is for you
				#main {
					margin-left: 10%;
					margin-right: 10%
				}
				

The margin at the left and right side will be set at 15% of the page width

And that's it. Good luck.

hostgator coupon |hotels in myrtle beach