css positon 属性---定位类型
position: static; 默认值,没有定位
position: inherit; 继承父元素的position
position: relative; 相对定位
position: absolute; 绝对定位
-
position: fixed;脱离正常的文档流,支持top,bottom,left,right 属性,固定在屏幕某个位置
它是固定在屏幕的某个位置,它不会随着浏览器滚动条的滚动而一起滚动。比如我们常见的回到顶部
的功能,按钮一直在浏览器的左下方,不管滚动条如何滚动,该按钮都会在左下方的固定的位置,这个需求就可以使用position: fixed
来完成。 position: sticky;
(新的属性值)
position :fixed 例
.botnav{
position fixed
bottom 0
left 0
z-index 1000
width 100%
background #fff
}