Asp.net 页脚div赢得';展开GridView时,请勿停留在下方
我有一个页面,其中有一个页脚,该页面还显示一个Gridview,Gridview的内容取决于用户选择的内容,Gridview可能从零到168行,以及介于两者之间的所有内容 母版页如下所示:Asp.net 页脚div赢得';展开GridView时,请勿停留在下方,asp.net,css,master-pages,footer,Asp.net,Css,Master Pages,Footer,我有一个页面,其中有一个页脚,该页面还显示一个Gridview,Gridview的内容取决于用户选择的内容,Gridview可能从零到168行,以及介于两者之间的所有内容 母版页如下所示: <html> <body> STUFF <div id="footer"> <p>This is the footer</p> </div> </body> </html> #footer
<html>
<body>
STUFF
<div id="footer">
<p>This is the footer</p>
</div>
</body>
</html>
#footer {
width: 100%;
height: 60px;
margin: 0 auto;
padding: 0;
background: #E1E1E1;
position:absolute;
bottom:0;
}
现在,我尝试了position:fixed,但它不是我想要的,这样页脚显示在页面内容上,我希望它位于底部。如果我将其设置为相对,它将设置为母版页内容占位符的底部,但您仍然可以在Gridview后面看到它,如果我将其设置为绝对,它将进入底部,但它仅在Gridview具有一定小的行时起作用,如果它必须显示多行,则页脚也将显示在Gridview后面
这让我快发疯了。谢谢你的建议。试试这个:
为什么不使用
来组织页面内容?!你的
在中丢失了,这是一个打字错误,我编造代码只是为了显示页脚的位置。
* {
margin: 0;
}
html, body {
height: 100%;
}
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -142px; /* the bottom margin is the negative value of the footer's height */
}
.footer, .push {
height: 142px; /* .push must be the same height as .footer */
}
/*
Sticky Footer by Ryan Fait
http://ryanfait.com/
*/