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

Clearfix and responsive navbar issues with Bootstrap

I'm trying to make a responsive navbar. I want the navbar-brand on left and toggle-button on right in mobile screens and navbar on left and menu on right on desktop. Problem is, when I float toggle-button right it looks like there's a clearing issue that clearfix doesn't fix. Instead the first item of the menu will nestle up next to the navbar-brand element.

Any idea how to fix this?

<nav class="navbar navbar-dark clearfix" style="background-color:#44c764">
      <a class="navbar-brand" href="#">HackShack</a>
      <button class="navbar-toggler hidden-sm-up pull-xs-right" type="button" data-toggle="collapse" data-target="#responsiveCollapse">
      </button>

      <div class="nav-block collapse navbar-toggleable-xs" id="responsiveCollapse"> <!-- class .navbar-toggleable-* -->

        <ul class="nav navbar-nav">
          <li class="nav-item active">
            <a class="nav-link" href="#">Stuff<span class="sr-only">(current)</span></a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="#">Cards</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="#">Buttons</a>
          </li>
          <li class="nav-item">
            <a class="nav-link" href="#">Badges</a>
          </li>
        </ul>
      </div>
    </nav>