Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

My Bootstrap nav won't close when in mobile view

My Bootstrap nav won't close in mobile view. I can open the nav but it won't close again. Is there an obvious answer to this?

I've tried various versions of jQuery, Bootstrap etc to narrow down the problem but haven't succeeded.

I've even replaced the content from opening to closing nav tag with a nav from a template and it still doesn't work.

ARRGGHHH. Any help would be appreciated,

<nav class="navbar navbar-custom navbar-fixed-top" role="navigation">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse">
                Menu <i class="fa fa-bars"></i>
            </button>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse navbar-right navbar-main-collapse">
            <ul class="nav navbar-nav">
                <!-- Hidden li included to remove active class from about link when scrolled up past about section -->
                <li class="hidden">
                    <a href="#page-top"></a>
                </li>
                <li>
                    <a class="page-scroll" href="#about">About</a>
                </li>
                <li>
                    <a class="page-scroll" href="#download">Download</a>
                </li>
                <li>
                    <a class="page-scroll" href="#contact">Contact</a>
                </li>
            </ul>
        </div>
        <!-- /.navbar-collapse -->
    </div>
    <!-- /.container -->
</nav>

Hey Tom, your code works as is (minus my inline style) if I'm on Bootstrap's site and in Firebug paste in your code above <header>. http://screencast.com/t/eQfbpEwCgc Hopefully a clue for you.

Hi Mark. Sorry for the late reply. I'm in the UK so was tucked up in bed when you replied last night.

Try tomstewardmedia.com/test

I tried looking at your video but didn't get too far. Again, any help appreciated. Thanks