我目前正在一個網站上工作,而且我對這個頁腳不會停留在頁面底部感到很生氣。我已經檢查了同樣問題的其他主題,但沒有解決我的問題。無法在頁面底部設置頁腳
當我嘗試「相對」時,頁腳在「topbox」(這是我的頁眉)下面,而當我嘗試「絕對」時,它會在頁面中間。
<header>
<div class="topbox">
<ul>
<li><a class="active" href="#home">Home</a></li>
<li><a href="#news">Services</a></li>
<li><a href="#contact">Clients</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
</div>
</header>
<body>
<div class="wrapper">
<div class="scrollbtn"><img src="Images/Scroll.png" style="width:40%"/>
</div>
<div class="bgbox">
<div class="box2">
<a> Lorem ipsum dolor sit amet, consectetur adipiscing elit...
</a>
</div>
</div>
<div id="footer">© 2017 "TEXT" All Rights Reserved</div>
</div>
</body>
所以在這裏我們有頂盒這是標題,包裝,scrollbtn(鼠標的PIC指示需要滾動),bgbox(內容的背景),BOX2(內容)中,「lorep存有「是用戶滾動的內容並且非常長。這是我的問題,當您向下滾動頁面時,頁腳處於頁面底部,因此處於頁面中間。
這裏是CSS:
body, html {
width:100%;
height:100%;
background-color: #060b0f;
padding:0%;
background-image: url('../images/background3.jpg');
background-size:cover;
background-repeat: no-repeat;
background-attachment: fixed;
}
/* HEADER */
.topbox {
margin:0%;
position: fixed;
top:0%;
left: 0%;
width:100%;
z-index:999;
text-align:center;
overflow: hidden;
padding:0%;
font-family:Impact;
font-size:20px;
}
.topbox ul {
list-style-type: none;
margin: 0%;
padding: 0%;
overflow: hidden;
background-color: #459cfe;}
.topbox li {
display: inline;
}
.topbox li a {
display: inline;
color: black;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
.topbox li a:hover:not(.active) {
background-color: #397fcd;
}
.active {
background-color: #fff;
}
/*HEADER FIN*/
.scrollbtn {
position: absolute;
bottom : 0%;
left: 49%;
}
.hot {
color:#4080e1;
}
.box2 {
margin-top:0px;
margin-left:10%;
width : 70%;
opacity:1;
color: black;
overflow: hidden;
text-align:center;
z-index:4;
background-color:transparent;
}
.box2 a{
opacity:1;
}
.bgbox {
margin-top:0px;
margin-left:8%;
padding: 5%;
padding-left: 8%;
width : 70%;
position: absolute;
top : 10%;
left: 0%;
background-color: rgba(255,255,255,0.5);
overflow: hidden;
text-align:center;
z-index:3;
}
.bgbox:hover {
background-color: rgba(255,255,255,0.9);
}
#footer {
font-size:20px;
cursor:pointer;
color: black;
text-align: center;
width:100%;
position:relative;
left:0px;
bottom:0px;
background-color: #459cfe;
}
.wrapper {
height:100%;
}
我已經嘗試了很多不同的東西(改變車身高度,包一切,相對的,絕對的,固定的,靜態的,...),我想不出其他的東西。我需要一個外部觀點。
'topbox'必須位於body標籤內。我不是說這是一個修復,但只是指出這個問題,還是它的錯字 –
不,這不是一個錯字,但它似乎並沒有問題,謝謝 –