如何在页眉和页脚中添加边距? [包括截图]

时间:2010-11-11 17:25:03

标签: css html margin

如何让我的网站看起来更像下面的第二张图片? (注意第二个图像中的左边距,而不是第一个图像中的边距。)

http://fotografcim-2.hosting.parking.ru/(这是一个演示网站。)

无保证金: Before

边距: After

2 个答案:

答案 0 :(得分:0)

我会将所有内容包围在包装器中,并将该包装器的width设置为内部div的当前宽度。

答案 1 :(得分:0)

div#outer {
background-color:#FFFFFF;
border:1px solid #D0D4C9;
margin:0 auto 5px;
padding:0;
width:80%;
}

以上是你的风格

我删除边距中的自动:

根据需要设置保证金

margin:0 5px;

使用FF Firebug插件以便更好地理解

参考这些

http://www.webreference.com/authoring/style/sheets/layout/advanced/

http://www.yourhtmlsource.com/examples/positioning2.html