我正在尝试删除我正在处理的布局的顶部间距,您可以在此处查看:50.116.81.173/~speedcit/wordpress/。但是,我似乎不太幸运。我本质上想删除页面顶部的白色间距。

以下是我当前使用的CSS代码:

body, html {
    font-family: Arial;
    font-size: 11.5pt;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
}

table, tr, td, div {
    font-family: Arial;
    font-size: 11.5pt;
}

#outer {
    text-align: center;
    margin: 0px;
}

#wrapper {
    border-left: 1px #000000 dotted;
    border-right: 1px #000000 dotted;
    padding-top: 2px;
    padding-left: 2px;
    text-align: left;
    width: 1024px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    min-height: 100%;
}

#header {
    background-image: url(http://50.116.81.173/~speedcit/images/header.jpg);
    width: 1024px;
    height: 280px;
}

#menu {
    width: 1024px;
    height: 61px;
}

#content {
    background-image: url(http://50.116.81.173/~speedcit/images/content-bg.jpg);
    background-repeat: no-repeat;
    width: 804px;
    height: 357px;
    padding-top: 80px;
    padding-bottom: 10px;
    padding-left: 110px;
    padding-right: 110px;
    line-height: 24pt;
}

#footer {
    margin: 0px;
    padding: 0px;
}

.txt {
    color: #BF2736;
    font-weight: bold;
}

最佳答案

将#wrapper的填充更改为零

#wrapper {
    border-left: 1px #000000 dotted;
    border-right: 1px #000000 dotted;
    padding-top: 0px; -- Change This to zero!!!
    padding-left: 2px;
    text-align: left;
    width: 1024px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    min-height: 100%;
}


您可能需要阅读有关CSS重置工具的信息

http://meyerweb.com/eric/tools/css/reset/


  重置样式表的目的是减少浏览器中的不一致
  例如默认的行高,标题的边距和字体大小,
  等等

07-28 01:28
查看更多