...

View Full Version : How to center my webpage ?



rotexhawk
02-10-2012, 10:13 PM
Hello,

I am having difficulty aligning my website correctly. The problem is that I have set up margins for the div tags and the auto margin doesn't work. Is there an easy solution to fix this issue.

Below is the link to the website.


http://grabbanddurando.com/gdpublic/

dylanbaumannn
02-10-2012, 11:18 PM
Hello Rotexhawk!

Welcome to CodingForums.com, we're glad to help :D

It's never too late to use auto margins! All you need to do is create a container that sits outside all of your content (so it includes your #top and #footer). Then just apply the centering properties to the container :D

HTML


<div id="centered-container">
(all of your current body content)
</div>


CSS


#centered-container {
width:960px;
margin:0px auto;
overflow:auto;
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum