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,我有一个django项目。在html模板中,页面长度可能不是恒定的,因为如果要提供更多的输入,页面长度可能会更长 我可能需要调整页面的长度以显示页脚 我尝试为页脚使用relativeposition样式,但它可能不会很好地显示,因为如果信息太少,页脚可能会升得太高 因此,由于页面的长度,我可能需要调整页脚位置 怎么能证明这么长?谢谢 相对位置参照父元素。那么,在这种情况下,你必须使用绝对值,使它始终位于底部,与身体或父母的高度无关 footer { position: absolute;

我有一个django项目。在html模板中,页面长度可能不是恒定的,因为如果要提供更多的输入,页面长度可能会更长

我可能需要调整页面的长度以显示页脚

我尝试为页脚使用
relative
position样式,但它可能不会很好地显示,因为如果信息太少,页脚可能会升得太高

因此,由于页面的长度,我可能需要调整页脚位置


怎么能证明这么长?谢谢

相对位置参照父元素。那么,在这种情况下,你必须使用绝对值,使它始终位于底部,与身体或父母的高度无关

footer {
  position: absolute;
  bottom: 0;
}
然后,如果您定义一个高度,它会更好,否则页脚将位于页面内容的顶部。然后:

footer {
  position: absolute;
  bottom: 0;
  height: 200px // for exemple
}

.page-content {// or body
  padding-bottom: 200px // height of the footer
}
希望有帮助。

如果我理解正确: