Sticky top div with absolute positioning

后端 未结 6 1535
温柔的废话
温柔的废话 2020-12-30 00:48

I\'m using absolute positioning to have a div fill up the entire browser window. However, I wan\'t to combine this with a sticky div that sometimes is there and sometimes no

6条回答
  •  一个人的身影
    2020-12-30 01:34

    • Add fixed height & width 100% to alert + position:fixed
    • Add padding-top to content
    • Only downfall is of course the extra padding if there is no alert...

    See http://jsfiddle.net/aDdRS/5/

提交回复
热议问题