HTML固定底部
-
如何在HTML中将元素固定在底部?
在HTML中设置元素位于底部,可使用CSS实现:1.绝对定位(position:absolute;bottom:0)适用于父容器相对定位;2.Flex布局(display:flex;flex-direction:column;justify-content:space-between)使内容自动撑开;3.固定定位(position:fixed;bottom:0)始终固定在视窗底部。
在HTML中设置元素位于底部,可使用CSS实现:1.绝对定位(position:absolute;bottom:0)适用于父容器相对定位;2.Flex布局(display:flex;flex-direction:column;justify-content:space-between)使内容自动撑开;3.固定定位(position:fixed;bottom:0)始终固定在视窗底部。