div不会停留在浏览器底部
div will not stay at the bottom of the browser
我正在尝试让#footer div 留在#content div 和 #sidebar [=27] 的底部=], 但是曾经在别处有用的东西,现在好像不想再用了,我很茫然。
在这里工作:http://wiki.tf-575.com/index.php?title=RBL_Store
但不在这里:http://beta.tf-575.com/index.php?title=RBL_Store
body {
background: #020B12;
font: x-small sans-serif;
color: B3DFFC;
margin: 0;
padding: 0;
text-align: center;
}
#container {
background: #020B12 url(background-tile.png) top left repeat-y;
font: normal;
width: 100%;
margin: 0 auto;
text-align: left;
}
#header {
background: #020B12;
color: B3DFFC;
padding-top: 1px;
padding-bottom: 67px;
}
#sidebar {
background: none;
float: left;
margin-bottom: 84px;
padding: 0 1px;
width: 164px;
top: 80px;
position: absolute;
}
#content {
color: #446C90;
margin-top: -48px;
min-width: 960px;
font-size: 120%;
text-align: left;
padding: 0 20px 0 165px;
}
#footer {
background: url("footer.png") no-repeat scroll left bottom transparent;
clear: both;
color: #446C90;
font-size: 90%;
min-height: 82px;
margin: 0;
padding: 82px 0 0 165px;
text-align: center;
}
<body>
<div id="container">
<div id="header">
<snip />
</div>
<div id="sidebar">
<snip />
</div>
<div id="content">
<snip />
</div>
<div id="footer">
<snip />
</div>
</div>
</body>
尝试将页脚的宽度设置为 100%
您的问题是,在测试版网站上,侧边栏是绝对定位的,因此浮动被忽略,
clear:both;
不再下推页脚
我正在尝试让#footer div 留在#content div 和 #sidebar [=27] 的底部=], 但是曾经在别处有用的东西,现在好像不想再用了,我很茫然。
在这里工作:http://wiki.tf-575.com/index.php?title=RBL_Store 但不在这里:http://beta.tf-575.com/index.php?title=RBL_Store
body {
background: #020B12;
font: x-small sans-serif;
color: B3DFFC;
margin: 0;
padding: 0;
text-align: center;
}
#container {
background: #020B12 url(background-tile.png) top left repeat-y;
font: normal;
width: 100%;
margin: 0 auto;
text-align: left;
}
#header {
background: #020B12;
color: B3DFFC;
padding-top: 1px;
padding-bottom: 67px;
}
#sidebar {
background: none;
float: left;
margin-bottom: 84px;
padding: 0 1px;
width: 164px;
top: 80px;
position: absolute;
}
#content {
color: #446C90;
margin-top: -48px;
min-width: 960px;
font-size: 120%;
text-align: left;
padding: 0 20px 0 165px;
}
#footer {
background: url("footer.png") no-repeat scroll left bottom transparent;
clear: both;
color: #446C90;
font-size: 90%;
min-height: 82px;
margin: 0;
padding: 82px 0 0 165px;
text-align: center;
}
<body>
<div id="container">
<div id="header">
<snip />
</div>
<div id="sidebar">
<snip />
</div>
<div id="content">
<snip />
</div>
<div id="footer">
<snip />
</div>
</div>
</body>
尝试将页脚的宽度设置为 100%
您的问题是,在测试版网站上,侧边栏是绝对定位的,因此浮动被忽略,
clear:both;不再下推页脚