I am not sure if the theme you are using has something like <div id=”wrapper”> in the “header.php” template file, but if it does then you can specify the following CSS in your “style.css” file to center the wrapper and everything inside of it:
#wrapper {
width: 980px;
margin-right: auto;
margin-left: auto;
}
The “width: 980px;” line needs to be set to a certain width in pixels for this to work. The “auto” for “margin-right” and “margin-left” tell it to center the 980 pixel wide wrapper.
This is what I have in my style.css file
I made your suggested changes and it did not work.
body {
background: #111111 url(images/bg.png);
width: 980px;
color: #333333;
font-size: 12px;
font-family: Arial, Tahoma, Verdana;
margin: 0px auto 0px;
padding: 0px;
}
#wrap {
background: #EEEEEE;
width: 960px;
margin: 10px auto 10px;
padding: 10px;
position: center;
border: 10px solid #333333;
}
I tried a couple things.. i have also tried margin: 0 auto;
Someone told me that might work.. still nothing..
any other suggestions?
remove the position center;
have
width:960px;
margin: 0 auto;
to center align the text add
text-align:center;
I changed to your suggestions
#wrap {
background: #EEEEEE;
width: 960px;
margin: 0 auto;
padding: 10px;
border: 10px solid #333333;
}
It still does not center the entire page. When I added the text-align: center; it moved my logo in the header over a bit and centered it in the space it had.
i’m all out of ideas on what to try.. help =/
it means either the div name isn’t right, or some code elsewhere is stopping it
post your header.php and style.css please
Sorry but this is going to be a long post.. hehe
[huge chunk of code moderated – please use a pastebin or link to file]
The “body” tag should not have a width set. Remove the “width: 980px;” line under the “body” section in your CSS and see if that helps.
its all fixed.. thanks for everyones input. A bad sidebar widget made it align left. At least thats what it seems to be.. its in the center now so i’m not complaining
Thanks again
Hi everyone!
I’m not really replying to most of the support forums/posts that I’ve been to, even those that were able to help me.
But now, I would say that this thread really helped me in my problem with one of the websites I’m working on.
I followed the solution to remove the “width” on the body tag of my style.css and voila! it worked like magic…
Thanks Guys!!!
BONGZKIE