Html CSS:将页脚始终放在底部

Html CSS:将页脚始终放在底部,html,css,position,Html,Css,Position,我有以下页面布局: <header></header> <div id="content"></div> <aside></aside> <footer> <ul> <li></li> </ul> </footer> 现在,负利润率不是最好的解决方案。 有没有更好的方法将页脚直接放在角落里 关于这样写: text-align: left; po

我有以下页面布局:

<header></header>
<div id="content"></div>
<aside></aside>
<footer>
 <ul>
  <li></li>
 </ul>
</footer>
现在,负利润率不是最好的解决方案。 有没有更好的方法将页脚直接放在角落里

关于

这样写:

text-align: left;
position: fixed;
bottom: 0;
left:0
height: 58px;
position:relative;
bottom: -58px;
查看此站点

示例:

* {
    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 */
}
<div id="footer"></div>
#footer {
   position:absolute;
   bottom:0;
   width:100%;
   height:60px;   /* Height of the footer */
   background:#6cf;
}

对我来说,它是这样工作的:

text-align: left;
position: fixed;
bottom: 0;
left:0
height: 58px;
position:relative;
bottom: -58px;
请注意
高度
底部
的值相同。和
位置
相对
HTML:

* {
    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 */
}
<div id="footer"></div>
#footer {
   position:absolute;
   bottom:0;
   width:100%;
   height:60px;   /* Height of the footer */
   background:#6cf;
}

你用的是什么浏览器?在chrome上剪切测试文本。没有负边距就可以了。映射(页脚和页脚ul之间的边距)时出错。您好,谢谢您的帮助。不幸的是,我还有另一个问题:当我设置页脚的宽度和填充时,李的页脚不是在一条线上,而是在彼此下面。如果我将宽度和填充设置为页脚ul,这很好..嗨,已经解决了。忘记修复子元素的边距/填充:)