我正在尝试创建类似于yahoo.com的东西,其中内容位于中间位置,郊外有一个灰色边距(或者至少看起来像一个边距,不确定它是否是填充)。我成功了,但是当页面被用户调整大小时,我希望这个页边距可以像在yahoo.com上一样减小,但不会减小(转到www.yahoo.com并调整页面大小并调整页边距)。任何人都知道如何让这个边际减少?随着窗口尺寸减小,边距减少
body
{
font-family: "Lucida Grande", "Lucida Sans";
background-color: #525252;
text-align: center;
margin-left: 150px;
margin-right: 150px;
margin-top: 0px;
margin-bottom: 0px;
min-width: 650px;
min-height: 685px;
color: #00008B;
}
table
{
margin:0;
padding: 0px 2px;
border-spacing: 0; /* remove the spacing between the borders. */
width: 950px;
height: 685px;
background-color: #C1CDC1;
}
我也不得不放在身体:margin-left:auto; margin-right:auto;不知道为什么,但当我做到了,它完美的工作。 –