祝你有美好的一天。我正在处理一个网页,但我一直在定义最大和最小宽度。基本上,当像大多数网页一样缩小网页时,我希望我的页面居中。请需要专家帮助。尽快谢谢。
body
{
height:100%;
width:100%;
margin:0 auto;
background-image: -webkit-linear-gradient(top, #E5E5E5 30%, #999);
background-image: -moz-linear-gradient(top, #E5E5E5 30%, #999);
background-image: linear-gradient(top, #E5E5E5 30%, #999);
}
#mainContainer
{
background-image:url(bg3.jpg);
background-repeat:repeat;
background-color:#999;
width:70%; /*default width in percent for a liquid layout.
the problem is when I zoom out the page the width remains to be in 70% therefore forcing the contents to be pushed to the left corner instead of being centered.*/
min-width:940px;
margin:5px auto;
height:100%;
padding:0 1% 0 1%;
-webkit-border-radius: 10px;
border-radius: 10px;
}