我有一个带有页脚 div 的简单母版页。但是它在内容页和页脚之间出现了一个空隙。可能是什么原因?
<body >
<form id="form1" runat="server">
<div>
<table cellpadding="0" cellspacing="0" class="mmaintable">
<tr>
<td class="mmaintableside"> </td>
<td class="mmaintablemiddle" colspan="4">
<table cellpadding="0" cellspacing="0" class="munmaintable">
</table>
</td>
<td class="mmaintableside"> </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/