top nav bar blocking top content of the page

前端 未结 19 1626
孤城傲影
孤城傲影 2020-11-28 00:48

I have this Twitter Bootstrap code

  
19条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 01:35

    In my project derived from the MVC 5 tutorial I found that changing the body padding had no effect. The following worked for me:

    @media screen and (min-width:768px) and (max-width:991px) {
        body {
            margin-top:100px;
        }
    }
    @media screen and (min-width:992px) and (max-width:1199px) {
        body {
            margin-top:50px;
        }
    }
    

    It resolves the cases where the navbar folds into 2 or 3 lines. This can be inserted into bootstrap.css anywhere after the lines body { margin: 0; }

提交回复
热议问题