html - 为什么我的内容页和页脚之间有空隙?

标签 html css

我有一个带有页脚 div 的简单母版页。但是它在内容页和页脚之间出现了一个空隙。可能是什么原因?

enter image description here

<body >
<form id="form1" runat="server">
<div>
    <table cellpadding="0" cellspacing="0" class="mmaintable">
         <tr>
        <td class="mmaintableside">&nbsp;</td>
        <td class="mmaintablemiddle" colspan="4">
            <table cellpadding="0" cellspacing="0" class="munmaintable"> 
                </table>
                </td>
        <td class="mmaintableside">&nbsp;</td>
   </tr>
   </table>
    <div class="contentpage">
    <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
    </asp:ContentPlaceHolder>
        <div class="Footercontent">
            <h2>Footer
            </h2>
        </div>
    </div>
</div>
</form>
</body>

如您所见,我没有在 contentplaceholder1 和页脚之间留下任何 tr 或 div。

我的CSS:

    .mmaintable {
        width: 100%;
        padding:0;
    }
    .mupdatepaneltable {
        width: 100%;
    }
    .mmaintableside {
        width: 198px;
    }
    .mmaintablemiddle {
        width: 938px;
    }
    .munmaintable {
        width: 938px;
    }
    .munmaintable1 {
        text-align:right;
        width: 234.5px;
        color: #CCCCCC;
    background-color: #FF0066;
    }
    .munmaintable2 {
        text-align:left;
        width: 234.5px;
        color: #CCCCCC;
     background-color: #FF0066;
    }
    .munmaintable3 {
        text-align:left;
        width: 234.5px;
        color: #CCCCCC;
     background-color: #FF0066;
    }
    .munmaintable4 {
        text-align:left;
        width: 234.5px;
        color: #CCCCCC;
     background-color: #FF0066;
    }
    .mmergedunmaintable23 {
        width: 300px;
        color: #CCCCCC;
        text-align:center;
            }
    .backgroundimage {
    background-position: center;
   -webkit-background-size: cover;
   -moz-background-size: cover;
   -o-background-size: cover;
   background-size: cover;
   background-image: url('../Images/stadium2.png');
   background-repeat: no-repeat;
   background-attachment: fixed;
 }
    #ContentPlaceHolder1
    {
        width:938px;
        text-align:center;
    }
    .contentpage{
        width:938px;
        text-align:center;
        margin:0 auto;
    }
    .Footercontent {
        width:938px;
        text-align:center;
        margin:0 auto;
        background-color:#FF0066;
   }
    .clear {
        clear:both;
    }

最佳答案

试试这个...

CSS

.Footercontent {
    width:938px;
    text-align:center;
    margin: -20px auto 0 auto;
    background-color:#FF0066;
}

关于html - 为什么我的内容页和页脚之间有空隙?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31389146/

相关文章:

javascript - 使用 JQuery 将未格式化的 JSON 文本添加到 ACE Editor Div

html - 如何阻止移动 CSS 被主 CSS 覆盖

html - 关于使用960网格系统进行CSS设计的问题

javascript - 窗口调整大小时的 CSS 动态边距

html - 相当于纯装饰性视频的空替代文字

html - 响应图像悬停缩放

html - Bootstrap 3 选项卡悬停样式问题

javascript - 使用javascript管理导航栏

html - 固定背景,前面元素的内容可滚动

html - 我的新 div 元素没有出现在网页中。看起来,div 元素隐藏在背景图片后面