问题
I have got a css problem.
http://www.luukratief-design.nl/dump/parallax/index.html
I cant get this page to align center. Before i get the answer to use "text-align: center;" on the body, i already did.
The page 100% validates (CSS and HTML).
Please help, never had this before.
回答1:
Set the left and right margins of the #wrapper
div to auto
#wrapper{
margin:0 auto;
}
回答2:
to align a page in the center you can place all the content of the page inside a container div and set these css properties
body
{
text-align: center; //for ie 6
}
#main_wrapper
{
text-align: left;
width: 1000px; //any width you want
margin: 0 auto;
}
here main wrapper is the div that contains all the content
回答3:
add this to you wrapper:
margin-left:auto;
margin-right:auto;
回答4:
Use this css to align to center:
<style>
#your_div_id {margin:0px auto;}
</style>
来源:https://stackoverflow.com/questions/2279295/page-will-not-align-center