如何使用 CSS 建立固定/粘性頁面頁尾?
要使用 CSS 建立固定頁尾,程式碼如下 −
示例
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body{
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.footer {
font-size: 20px;
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: rgb(50, 6, 100);
color: white;
text-align: center;
}
</style>
</head>
<body>
<h1>Fixed/Sticky Footer Example</h1>
<div class="footer">
<p>All rights reserved ©</p>
</div>
</body>
</html>輸出
以上程式碼將產生如下輸出 −

廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP