Bootstrap Collapsed Nav无法正常工作

时间:2016-04-22 10:02:29

标签: html css twitter-bootstrap

您好,我有一个网站,我忙着,出于某种原因,当我的屏幕是移动的,响应式菜单显示时,我点击按钮,折叠菜单不会推动内容。我向导航栏添加了70px的高度。我的问题是如何让我的崩溃工作在70px的高度?当我删除70px的导航栏高度时,它可以工作,但会在底部的导航栏中添加填充

这是我的导航代码:

<body>
<nav class="nav-wrapper">
    <div class="container">
        <nav class="navbar navbar-inverse navbar-static-top" role="navigation">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                    <span class="sr-only">MENU</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="<?= base_url(); ?>">Ventech IT</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse navbar-ex1-collapse">
                <ul class="nav navbar-nav navbar-right">
                    <li class="<?= ($this->uri->segment(1) === 'home') ? 'active' : '' ?>">
                        <a href="<?php echo base_url(); ?>home">HOME</a>
                    </li>
                    <li class="<?= ($this->uri->segment(1) === 'our-services') ? 'active' : '' ?>">
                        <a href="<?php echo base_url(); ?>our-services">SERVICES</a>
                    </li>
                    <li class="<?= ($this->uri->segment(1) === 'support') ? 'active' : '' ?>">
                        <a href="<?php echo base_url(); ?>support">IT SUPPORT</a>
                    </li>
                    <li class="<?= ($this->uri->segment(1) === 'news-and-info') ? 'active' : '' ?>">
                        <a href="<?php echo base_url(); ?>news-and-info">KNOWLEDGE BASE</a>
                    </li>
                    <li class="<?= ($this->uri->segment(1) === 'shop') ? 'active' : '' ?>">
                        <a href="<?php echo base_url(); ?>shop">SHOP ONLINE</a>
                    </li>
                    <li class="<?= ($this->uri->segment(1) === 'contact-us') ? 'active' : '' ?>">
                        <a href="<?php echo base_url(); ?>contact-us">CONTACT US</a>
                    </li>
                </ul>
            </div><!-- /.navbar-collapse -->
        </nav>
    </div>
</nav>

我的容器CSS如下:

.nav-wrapper {
    width: 100%;
    padding: 0;
    margin: 0 0 20px;
    height: 70px;
    background-color: $navigation-bg;
    -webkit-box-shadow: 0 2px 2px rgba(0, 0, 0, 0.5);
    -moz-box-shadow: 0 2px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.5);
}

0 个答案:

没有答案