Preventing element from displaying on top of footer when using position:fixed

后端 未结 4 1888
难免孤独
难免孤独 2021-01-06 23:35

I\'d like to use the CSS property position:fixed to fix the position of an element but at the same time prevent the element from being positioned over my footer when the use

4条回答
  •  自闭症患者
    2021-01-07 00:04

    As long as all the elements are positioned (absolute or relative) you can use the z-index attribute. The default value is 0, so give your footer a higher value and it will appear above the other content.

提交回复
热议问题