how do i center my site? it’s on the left side and i want it in the middle.
thanks,
Peter
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
February 25, 2012 6:43am
Subscribe [3]#1 / Feb 25, 2012 6:43am
how do i center my site? it’s on the left side and i want it in the middle.
thanks,
Peter
#2 / Feb 26, 2012 7:54am
Hi Peter,
Typically centering a site is done with a combination of html and css. To do this you would wrap all of your code inside the body tag with a another div like this:
<html>
<head>
</head>
<body>
<div id="wrapper">
your site code here
</div>
</body>
</html>In the CSS file for your site you would then add this:
#wrapper {
width: 960px;
margin: 0 auto;
}Does that help?
Sean
#3 / Feb 26, 2012 11:15pm
i don’t get it…what tells it to center? i already have that code in the page & it doesn’t work.
#4 / Feb 27, 2012 5:41am
You’re going to have to provide us with the code you’re currently using or a link to the page in question or this will not be very easy to troubleshoot! 😉
What Sean has shown above definitely works so we need to see where it’s not working for you.
Best wishes,
Mark
#5 / Feb 27, 2012 2:15pm
agreed, here ya go:
#6 / Feb 27, 2012 3:16pm
I can’t see any margin: 0 auto; in your stylesheet anywhere. Have you tried as was suggested above?
I would suggest making a brand new blank template and just literally placing the code shown above and getting things working like that so you can see what is going on. Then you can try working your code around it.
Best wishes,
Mark
#7 / Feb 27, 2012 4:28pm
Hello
Sean’s CSS will do the job for you. And Mark has a great suggestion. Thanks Mark!
If these do not work, please let us know. We will do our best to help you out!
Cheers,
#8 / Feb 27, 2012 8:41pm
Doh! you’re right Sean. I had the margin parameter somewhere else & thought it was good enough, it wasn’t. Thank you guys, you rock once again! 😊
#9 / Feb 28, 2012 1:50pm
Hello turnstile,
I am glad we could help.
Happy coding!
Cheers,