在asp.net页面中的CSS粘性页脚

Fiv*_*ols 3 html css asp.net

我正在尝试创建一个粘贴到页面底部的页脚.我有:

<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>
Run Code Online (Sandbox Code Playgroud)

这是我的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;
}
Run Code Online (Sandbox Code Playgroud)

我错过了什么?页脚显示在视口下方(滚动条也在页面上).我期待它是某种类型的保证金问题.

Dav*_*ave 6

看看这个:http://matthewjamestaylor.com/blog/keeping-footers-at-the-bottom-of-the-page

  • 不得不将表单元素添加到关于body和html元素的css规则,然后它工作. (4认同)