Moving DOM elements below a fixed navigation bar

前端 未结 2 1220
死守一世寂寞
死守一世寂寞 2020-12-22 06:17

I have a fixed navigation bar, however, any time I try to create content after it, the content clips the navigation.

I could fix this by using relative positioning

2条回答
  •  轮回少年
    2020-12-22 07:09

    You can put nav inside a div , then set the height of the div by nav height. The advantage of this: easier and more meaningful,and In other places you can use other code without concerns..

    
    

    EXAMPLE

提交回复
热议问题