我的頁腳有一個大問題。我搜索了1小時,現在試圖找到解決辦法。我嘗試了一切,沒有任何工作!CSS/HTML頁腳不粘連
下面是我的HTML結構的例子。部分,然後在頁腳後面。
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<header>
Hello World
</header>
<nav>
Navigation
</nav>
<section>
Hellooooo!
</section>
<footer id="fixed">
Footer
</footer>
</body>
</html>
這是我的CSS:
footer {
bottom: 0;
width: 100%;
height: 60px;
background-color: #333333;
padding-top: 15px;
color: #fff;
font-family: 'Germania One', cursive;
}
#fixed {
position: relative;
bottom: 0;
}
body {
font-family: sans-serif;
background-color: #4F4F4F;
padding: 0;
margin: 0;
height:100%;
position: relative;
}
section {
padding-bottom: 30px;
position: relative;
min-height: 100%;
}
我把它粘在底部與position: static;
但隨後在部分重疊我的內容!我怎樣才能讓它堅守底部,而不會重疊我的文字?如果它們彼此接近,我希望節和頁腳之間有30像素的空間。
增加了新的答案,對不起 –