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

前端 未结 2 2130
慢半拍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:36

    You need to have a div and assign the CSS classes:

    .className {
    width: 100%;
    position: fixed;
    top: 0px;
    height: 75px;
    }
    

    Then on your div have:

    Whatever

提交回复
热议问题