CSS3如何实现footer固定在底部

CSS3如何实现footer固定在底部

小编给大家分享一下CSS3如何实现footer固定在底部,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!

前言

把 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>

看完了这篇文章,相信你对“CSS3如何实现footer固定在底部”有了一定的了解,如果想了解更多相关知识,欢迎关注行业资讯频道,感谢各位的阅读!