【发布时间】:2014-03-23 13:18:21
【问题描述】:
经过几天的搜索使页脚粘在页面末尾的代码,我终于找到了可行的方法。
但现在我意识到,如果您有特定的分辨率,它只会停留在页面的末尾。 如果有人拥有更大的屏幕或正在全视图查看页面,那么它就不再工作了。
请帮忙?
而且,我还知道那些非常著名的粘性页脚网站。似乎无法在这里找到答案 我需要有关我的代码的具体帮助。
谢谢!
母版:
<form id="form1" runat="server">
<div class="page">
<div class="header">
</div>
<div class="main">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
<div class="wrapper" />
</asp:ContentPlaceHolder>
</div>
<asp:ContentPlaceHolder ID="FooterPlaceHolder" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
CONTENTPAGE aspx
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<h2>Knowledge Base</h2>
<div class="push"></div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="FooterPlaceHolder" Runat="Server">
<div class="footer">
© "companyName"
</div>
</asp:Content>
CSS:
html {
height: 100%;*/
}
body
{
height: 100%;
margin: 0px;
}
.page
{
width: 1200px;
margin: auto;
height: 100%;
}
.main
{
text-align: left;
padding: 5px 15px;
margin-top: 10px;
}
.footer
{
text-align: center;
}
.wrapper
{
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0px auto -449px;
}
.push
{
clear: both;
height: 449px;
}
【问题讨论】:
标签: asp.net css master-pages sticky-footer