CSS to achieve a similar fixed floating div thast always on top of other divs - like stackoverflow does?

前端 未结 2 2125
慢半拍i
慢半拍i 2021-02-10 08:00

I\'d like to achieve a similar effect as the one in this image:

Basically, I want to have a div as a menu bar that\'s always on top - the div beneath it being

2条回答
  •  温柔的废话
    2021-02-10 08:34

    You need to use the position: fixed; property for #top div.

    #top { position:fixed; top:0px; width:100%; height:70px; }

提交回复
热议问题