我正在学习网络开发,我根本无法弄清楚我在这方面做错了什么.我希望此页面的页脚粘贴到所有内容下方的底部,但不会在屏幕中固定.问题是当身体高度超过100%时,页脚会停留在屏幕中间,而不是在底部.
我已经看过很多关于如何实现这个的教程,使用"position:absolute"+"bottom:0"和东西,但一切都失败了.
看看这个:
<html>
<head>
<meta charset="iso-8859-1" />
<link rel="stylesheet" type="text/css" href="index.css" />
<link href='https://fonts.googleapis.com/css?family=Arvo|Open+Sans|Ubuntu+Roboto' rel='stylesheet' type='text/css'>
<title>Matheus's Page</title>
</head>
<body>
<div id="wrapper">
<header>
<div class="title-div">
<h1>Title</h1>
</div>
<nav>
<ul>
<li><h3>Home</h3></li>
<li><h3>Articles</h3></li>
<li><h3>Perfil</h3></li>
<li><h3>Settings</h3></li>
</ul>
</nav>
</header>
<div id="body">
<p>Texto teste Texto teste Texto teste Texto teste Texto teste Texto teste Texto teste Texto teste Texto teste Texto teste </p>
</div>
<footer>
<p>Footer</p>
</footer>
<div>
</body>
Run Code Online (Sandbox Code Playgroud)
CSS:
body {
font-family: 'Arvo', serif;
height: 100%;
margin: 0;
padding: 0;
}
#wrapper …Run Code Online (Sandbox Code Playgroud)