目标:
把 footer 区固定在底部,无论页面高度多宽,它始终在底部不会变,就像移动端的菜单一样。
(推荐教程:CSS入门教程)
实例:
<!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>
相关视频教程推荐:css视频教程
立即学习“前端免费学习笔记(深入)”;
以上就是css如何实现始终将footer固定在底部的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号