我正在尝试创建一个粘贴在页面底部的页脚。我有:
<body>
<form id="form1" runat="server">
<div id="wrap">
<div id="content">
<uc2:logo ID="logo1" runat="server" />
</div>
</div>
<uc1:footer ID="footer1" runat="server" />
</form>
</body>
这是我的css
body {
margin: 30px 10px 0px 10px;
font-size: 14px;
font: 76% Arial,Verdana,Helvetica,sans-serif;
}
html, body, form, #wrap { height: 100%; }
form > #wrap { height: auto; min-height: 100%; }
#wrap {
width: 1000px;
margin: auto;
}
#content {
text-align:left;
}
#footer {
clear: both;
position: relative;
z-index: 10;
width:1000px;
margin:auto;
}
我错过了什么?页脚显示在视口下方(滚动条也在页面上)。我期待它是某种类型的保证金问题。
答案 0 :(得分:6)
答案 1 :(得分:1)
尝试绝对位置:
#footer {
clear: both;
position: absolute;
z-index: 10;
width:1000px;
margin:auto;
bottom:0px;
height:50px;
}