Bootstrap4设置footer固定在底部
时间:2021-03-04 16:48:33
收藏:0
阅读:273
1、html标签
将html显示高度占满(class="h-100")。
<html lang="en" class="h-100">
2、body标签
设置body弹性布局,并将高度占满(class="d-flex flex-column h-100")。
<body class="d-flex flex-column h-100">
3、main标签
将main设置为不同的屏幕设备不设置收缩(role="main" class="flex-shrink-0")。
<main role="main" class="flex-shrink-0">
弹性收缩规则:
- flex-shrink-0 不同的屏幕设备不设置收缩
- flex-shrink-1 不同的屏幕设备设置收缩
4、footer标签
设置footer顶部边框高度自动设置(class="mt-auto")。
<footer class="footer mt-auto py-3">
原文:https://www.cnblogs.com/xhubobo/p/14480703.html
评论(0)