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 Framework Basics Prototyping with Bootstrap Building a Fixed Navbar

Michael Randall
PLUS
Michael Randall
Courses Plus Student 10,643 Points

How come my navbar-toggle class links do not expand correctly when I click the hamburger icon when browser is xs or sm?

When my browser window is xs or sm and I click the hamburger icons, the links expand but they expand next to the navbar-brand class and not below it.

In the tutorial, when the instructor clicks the hamburger icon, the links appear on a line below the brand/icon. However when I click mine, they appear on the same line but right after the brand/icon. I've been following along with the tutorial, but typing my own content, so, assuming I haven't made mistakes, it should work as it does in the tutorial.

Anyone else experience this problem?

Nick Stoneman
Nick Stoneman
10,093 Points

Hey Michael. For me it was an issue of forgetting to add jquery to the top of my page. (I'm using hosted libraries vs downloading it all locally).

However if you're following along using the provided project files you should have jqeury already.

Post a code snippit if you're still stuck.

I'm having the same problem. Using Chrome and the project files. When reduced to the mobile icon the drop down stays next to the Ribbit and does not drop down. Any specific help is appreciated,

6 Answers

Harry Tran
Harry Tran
10,618 Points

Really weird issue I'm getting the same results, with updated version of Google Chrome, it just lined up against the side of the logo.

<EDIT:> https://teamtreehouse.com/forum/navbarbootsrap This is the best answer to how to fix it, you have to wrap everything in another div with class navbar-header. Robert goes on to explain the reasoning really well

Had the same alignment issues with the nav items not being placed underneath the line under "Ribit" logo.

Robert's answer in the link you shared solved it for me. Thanks!

John Lukacs
John Lukacs
26,806 Points

I figured it out add this code to your css !~~~ @media screen and (max-width: 730px) { a { display:block;
} }

Daniel Maldonado
Daniel Maldonado
18,756 Points

i am using navbar-header and still getting the incorrect results? am i missing something?

tony abat
tony abat
8,321 Points

I guess we are both missing something because all the solutions listed in this thread and all the rest do not work for me including the "navbar-header" class in bootstrap.

i opened up the "final" file that Gil Hernandez provides as a download with the class but his code doesn't work either.

Nothing more frustrating than the teachers code not working.

I guess i will remove the bootstrap sm and xs and work on the media query in the "mystyles.css" until I get it.

should be good practice.

Tony, did you ever figure this out?

Guil Hernandez could you offer some help? as i am having the same issue with Google Chrome!, works fine on safari?

John Lukacs
John Lukacs
26,806 Points

Its not working for me either