MVC 导航栏在最小宽度:768 像素和最大宽度:991 像素时隐藏页面标题和其他控件



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

此处附上问题屏幕截图

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');

最新更新