Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 不管发生什么事,都要让页脚保持向下_Html_Css - Fatal编程技术网

Html 不管发生什么事,都要让页脚保持向下

Html 不管发生什么事,都要让页脚保持向下,html,css,Html,Css,我试图使页脚保持在页面底部,所以当你向下滚动时,它应该保持在那里 我怎样才能做到最好 PS:我还没有任何代码,我只是在寻找如何以最好的方式完成这项工作。使用页脚上的以下代码使其固定在底部 例如, HTML: <div class="footer"><!-- Your footer code should be here. --></div> .footer{ position:fixed; bottom:0; } 这将使页脚停留在底部,保持

我试图使页脚保持在页面底部,所以当你向下滚动时,它应该保持在那里

我怎样才能做到最好


PS:我还没有任何代码,我只是在寻找如何以最好的方式完成这项工作。

使用页脚上的以下代码使其固定在底部

例如,

HTML:

<div class="footer"><!-- Your footer code should be here. --></div>
.footer{
    position:fixed;
    bottom:0;
}
这将使页脚停留在底部,保持固定


希望这能有所帮助。

只是一个评论:iOS在这方面有问题。只是一个问题:你看到了处理这个问题的方法吗?让身体有
位置:相对将是克服此问题的最佳方法。-@dollarvarCheck此链接作为参考---@DollarVarAvailable重复
#footer {
clear: both;
position: relative;
z-index: 10;
height: 3em;
margin-top: -3em;
}

This CSS can help you.
 For better explanation refer to this
 http://www.lwis.net/journal/2008/02/08/pure-css-sticky-footer/
 This blog can also do the needful
 http://fortysevenmedia.com/blog/archives/making_your_footer_stay_put_with_css/