position: fixed overlapping page

后端 未结 3 667
自闭症患者
自闭症患者 2021-01-22 16:33

Here is the fiddle. I am making a grocery list web app, and I am making the top div a fixed position. When I do this, the div seems to overlap the rest of the page. I have tried

3条回答
  •  盖世英雄少女心
    2021-01-22 17:28

    It's because you have two positions. Remove one and make it:

    #top {
        width: 100%;
        height: 40px;
        background: #96f226;
        text-align: center;
        font-size: 30px;
        color: #252525;
        position: fixed;
    }
    

提交回复
热议问题