当最小宽度:768px和最大宽度:991px时,MVC NavBar隐藏页面标题和其他控件

时间:2018-03-06 21:28:00

标签: c# css model-view-controller web-applications

我正在使用MVC的默认Bootstrap。当设备屏幕介于767px和991px之间时,如何让我的页面向下移动到导航栏下方?

Issue screenshot attached here

1 个答案:

答案 0 :(得分:0)

You can handle this by two ways one by css as below

 @media only screen and (min-width: 767px) and (max-width: 991px) {
.yourContainerClass{
margin-top:200px;//Here 200 is your header height for screen between 767px and 991px need to replace with actual height
}
}


Other way is using jquery as below

 var headerHeight=$('.yourHeaderClass').height();
        // headerHeight+=15; // maybe add an offset too?
        $('.yourContainerClass').css('margin-top',headerHeight+'px');