Bootstrap导航栏不会崩溃+小按钮

时间:2014-03-20 10:04:01

标签: html css twitter-bootstrap navbar

我正在建立一个网站。这是投资组合页面:www.alweso.2ap.pl/portfolio.html

在所有其他页面上,导航栏在手机上折叠,但不在此手机上。导航栏的代码与其他页面上的代码完全相同:

<div class="container">
<div class="row">
<div class="col-md-12">
 <nav class="navbar navbar-default" role="navigation">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#"><img src="images/logo-kolor.png" alt="cafeteria"  class="logo-kolor"/></a>
</div>

<!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li><a href="index.html" id="intro-scroll">Strona główna</a></li>
        <li><a href="omnie.html" id="about-us-scroll">O mnie</a></li>
        <li class="active"><a href="portfolio.html" id="services-scroll">Portfolio</a></li>
        <li><a href="#blog" id="portfolio-scroll">Blog</a></li>
        <li><a href="contact.html" id="team-scroll">Kontakt</a></li>
      </ul>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>
</div>
</div>
</div>

此外,用于过滤投资组合的投资组合页面上的按钮在移动设备上显得非常小。这是代码:

  <div class="container">
  <div class="row">
  <div class="col-md-12">
  <div class="btn-group">
  <button type="button" class="btn btn-large filter" data-filter=".wszystko">Wszystko</button>
  <button type="button" class="btn btn-large filter" data-filter=".niemowleta">Sesje niemowlęce</button>
  <button type="button" class="btn btn-large filter" data-filter=".dzieci">Sesje dziecięce</button>
  <button type="button" class="btn btn-large filter" data-filter=".sluby">Sesje ślubne</button>

</div>
</div>
</div>
</div>

CSS:

.btn, .btn-default, .btn:focus, .btn:hover, .btn:active {
margin-left: 0;
margin-right: 20px;
margin-bottom: 30px;
box-shadow: none;
-webkit-box-shadow: none;
border-radius: 0;
border: rgba(255,255,255,0) !important;
}

.btn, .btn-default {
 background-color: rgba(0,0,0,0.1);
 color: rgba(0,0,0,0.7);
}

如果涉及导航栏,我会复制粘贴其他页面中的代码,以确保它完全相同,但它根本没有帮助,而且我没有想法。非常感谢。

1 个答案:

答案 0 :(得分:1)

在html的第6行尝试并更改

<meta name="viewport" content="width=device-width, initial-scale=1">

我在W3C中验证了该页面,点击here查看