Home > Web Front-end > CSS Tutorial > How to implement css to always fix the footer at the bottom

How to implement css to always fix the footer at the bottom

王林
Release: 2020-03-11 10:59:13
forward
4702 people have browsed it

How to implement css to always fix the footer at the bottom

Goal:

Fix the footer area at the bottom. No matter how wide the page is, it will always be at the bottom, just like the menu on the mobile side.

(Recommended tutorial: CSS introductory tutorial)

Example:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>document</title>
 
<!-- css -->
<style>
#demo{
 position: fixed;
    left: 0px;
    bottom: 0px;
    width: 100%;
    height: 50px;
    background-color: #eee;
    z-index: 9999;
}
</style>
 
</head>
<body>
<footer id="demo">我是footer</footer>
</body>
</html>
Copy after login

Recommended related video tutorial: css video tutorial

The above is the detailed content of How to implement css to always fix the footer at the bottom. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template