简体   繁体   English

引导导航栏无法在平板电脑上正确显示

[英]bootstrap navbar not displaying correctly on tablet

I have a little problem, i got bootstrap navbar set up, but when i resize it to the tablet width, menu escapes the navbar and gets into content like shown here: 我有一个小问题,我设置了引导导航栏,但是当我将其调整为平板电脑的宽度时,菜单会退出导航栏并进入如下所示的内容:

http://oi57.tinypic.com/2uykv9g.jpg "see the problem" http://oi57.tinypic.com/2uykv9g.jpg “看到问题”

Is the menu too wide ? 菜单太宽了吗? Any help how to fix this would be greatly appriciated. 如何解决此问题的任何帮助将不胜枚举。

Code here: 代码在这里:

<div class="navbar navbar-fixed-top">
         <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="fa fa-bars color-white"></span>
                </button>

                    <a class="navbar-brand" href="index.html" ><img class="img-responsive" src="images/new.jpg"></a>
            </div>
            <div class="navbar-collapse collapse">



            <ul class="nav navbar-nav" >
                    <li class="active"><a href="#section-main"><i class="fa fa-home"></i></a></li>
                    <li><a href="#section-pakiety">Packages</a></li>
                    <li><a href="#section-works">Examples of webpages</a></li>
                    <li><a href="#section-about">Our Services</a></li>                     
                    <li><a href="#section-korzysci">Benefits</a></li>
                    <li><a href="#section-ref">References</a></li>
                    <li><a href="#section-contact">Contact </a></li>
                </ul>



            </div><!--/.navbar-collapse -->
        </div>
    </div>

Ok i fixed it, so in case somebody else is having that problem, all i did was scale down the logo (which was partially the problem) to 80% on devices smaller than 992px, gave it an absolute positioning etc, here is the css: 好的,我已将其修复,因此,如果有人遇到该问题,我所做的就是将小于992px的设备上的徽标(部分是问题)缩小到80%,并对其进行绝对定位,等等,这就是CSS :

@navbar-height: 150px;
@navbar-brand-vpadding: 10px;

.navbar-brand img {
  height: @navbar-height - @navbar-brand-vpadding * 2;
  position: absolute;
  top: @navbar-brand-vpadding;
}
@media (max-width: 992px) {
  .make-custom-class-here {
    width:201px;
    height:41px;
  }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM