如何將頁腳保留在頁面底部?我已經通過stackoverflow搜索,並沒有什麼似乎修復它。頁腳coninue遍佈整個地方,但永遠不會結束在底部請幫助。更新我的代碼的其他部分後,我的頁腳不斷移動。我該如何解決?
<!DOCTYPE HTML>
<html>
<head>
<link type="text/css" rel="stylesheet" href="dereke.css"/>
<title>
</title>
</head>
<body>
<div class="Header">
<p>Ohio State Buckeyes</p>
<div id="logo">
<img src="http://vignette2.wikia.nocookie.net/logopedia/images/6/6f/1000px-Ohio_State_Buckeyes_logo_svg.png/revision/latest?cb=20130425230958" />
</div>
<div id="navbar">
<ul>
<li>Home</li>
<li id="noUD">|</li>
<li>About Us</li>
<li id="noUD">|</li>
<li>Contact Us</li>
</ul>
</div>
</div>
<div class="MidBody">
<div id="leftbody">
<img src="http://printableteamschedules.com/images/collegefootball/ohiostatebuckeyesfootballschedule.gif" />
</div>
<div id="rightbody"></div>
<div id="lowerbody">
<img src="http://grfx.cstv.com/schools/osu/graphics/facilities/stadium-night-800x325.jpg" />
</div>
</div>
<div class="footer"></div>
</body>
</html>
我知道這個問題是在CSS:
.Header {
width: calc(100%-16px);
height: 150px;
border-radius: 5px;
}
.Header p {
color: white;
margin-top: -5px;
width: 600px;
font-size: 70px;
}
.MidBody {
background-color: #141414;
width: 100%;
height: 850px;
margin-top: 10px;
border-radius: 5px;
position: absolute;
display:block;
}
.footer {
bottom: 0;
left: 0;
right: 0;
height:100px;
width: 100%;
margin-top: -3em;
background-color: #CCCCCC;
border-radius: 5px;
}
#leftbody {
width: 49%;
height: 425px;
left: 0;
margin-top: 3px;
margin-left: 3px;
position:absolute;
z-index: 1;
border-radius: 5px;
}
#leftbody img {
width: 490px;
height: 420px;
border-radius: 5px;
margin-top: 2px;
margin-left: 2px;
}
#rightbody {
background-color: #F1F1F1;
width: 49%;
height: 425px;
right: 0;
margin-top: 3px;
margin-right: 3px;
position:absolute;
z-index: 1;
border-radius: 5px;
}
#lowerbody {
width: 99%;
height: 49%;
right: 0;
left: 0;
margin-left: auto;
margin-right: auto;
margin-top: 432px;
margin-bottom: 2px;
border-radius: 5px;
postion: relative;
}
#lowerbody img {
width: 800px;
height: 325px;
border-radius: 5px;
}
body {
background-color: black;
}
li {
display: inline;
padding: 1px;
text-decoration: underline;
}
#navbar {
width: 350px;
color: #F8F8F2;
font-family: Arial Black;
margin: -35px;
text-align: left;
line-height: 10px;
}
#noUD {
text-decoration: none;
}
#logo img {
margin-top: -150px;
margin-right: 50px;
width: 15%;
height: 15%;
float: right;
}
你是什麼意思「更新部分代碼」?你能提供一個現場演示或小提琴嗎?順便說一句:在兩個元素上聲明相同的「id」是無效的,但這不太可能導致問題。 – Arsylum