Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/86.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.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_Twitter Bootstrap_Bootstrap 4 - Fatal编程技术网

Html 如何使页脚始终位于底部,但不将其位置设置为固定(因为它位于实际内容的中间)

Html 如何使页脚始终位于底部,但不将其位置设置为固定(因为它位于实际内容的中间),html,css,twitter-bootstrap,bootstrap-4,Html,Css,Twitter Bootstrap,Bootstrap 4,我无法将页脚保持在底部,我在网上找到了一种方法,即保持其css位置不变。然而,如果我保持它固定,它是在底部,但超过了实际内容。如何解决这个问题,并在底部页脚像真正的网站有 如果CSS无法实现,则可能是引导?快速回答: <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> .foo

我无法将页脚保持在底部,我在网上找到了一种方法,即保持其css位置不变。然而,如果我保持它固定,它是在底部,但超过了实际内容。如何解决这个问题,并在底部页脚像真正的网站有

如果CSS无法实现,则可能是引导?

快速回答:

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.footer {
   position: fixed;
   left: 0;
   bottom: 0;
   width: 100%;
   background-color: red;
   color: white;
   text-align: center;
}
</style>
</head>
<body>

<h2>Fixed/Sticky Footer Example</h2>
<p>The footer is placed at the bottom of the page.</p>

<div class="footer">
  <p>Footer</p>
</div>

</body>
</html> 

.页脚{
位置:固定;
左:0;
底部:0;
宽度:100%;
背景色:红色;
颜色:白色;
文本对齐:居中;
}
固定/粘性页脚示例
页脚位于页面底部

页脚

互联网上充满了你需要的东西:


这就是你想要的:

你可以尝试在你的风格中使用“position=absolute”和“bottom=0”…你应该发布你的代码看看这个例子:Lucky me。。下次你发帖的时候。。如果没有代码,很难看到你的问题。我使用了你提到的同一个站点的代码。当页面上有内容且用户必须滚动时,页脚不在底部,它与内容重叠。此页面为您提供: