CSS3中将footer始终固定在底部的代码
发布时间:2023-10-17 14:52:48 所属栏目:语言 来源:
导读:把 footer 区固定在底部,无论页面高度多宽,它始终在底部不会变,就像移动端的菜单一样。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>document</title>
<!-- css -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>document</title>
<!-- css -->
把 footer 区固定在底部,无论页面高度多宽,它始终在底部不会变,就像移动端的菜单一样。 <!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> (编辑:聊城站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐