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

HTML How to Make a Website Responsive Web Design and Testing Adjust the Profile Page and Header

Daniel Riches
Daniel Riches
19,847 Points

My navigation links are wrapping to a second line at the 660 break point, but only for a moment.

At the 660px breakpoint, my Contact link is wrapping onto a second line. Although if the user continues to minimize or maximize the window it goes back to the correct display. It looks like Nick's also does this in the video, but it's so quick that it's almost unnoticeable. Is there a quick and easy solution to this, or do we learn how to take care of this in a later video?

6 Answers

This happens because there is not enough place for all three navigation items at some point. Easy fix for this is changing your navigation anchors left and right padding to smaller.

So now it's "padding: 15px 10px", try changing it to "padding: 15px 9px;" or even less if needed.

Hope this helps!

Or adjust the breakpoint.

It just comes down to numbers, when the width is just a few pixels too large for everything to fit at a particular width.

Mark Darling
Mark Darling
553 Points

I don't recall what the exact values were that Nick set the "nav a{}" paddings to when writing that section of code on the videos, but I found that mine were set to 15px and 18px instead of the 15px and 10px mentioned as the 'original values' above by user Riku S. (I probably messed up while following along from the video as Nick was typing.)

Upon changing the padding to 15px and 10px, this solved my issue of the nav bar wrapping in a narrow range of desktop-sized display range like the OP.

Before figuring that out however, I did try adjusting the media query as suggested by some of the other responses to the OP and changing the target sizes DID NOT solve the problem- for me at least.

Yeah if there's a max-width set on something else, then changing the media query won't help if the same rule is applied.

Brent Lageson
Brent Lageson
4,452 Points

I was having the exact same issue, I changed my min-width to 680px and now it works prefect!

Caleb Kleveter
MOD
Caleb Kleveter
Treehouse Moderator 37,862 Points

Like Iain said, if you change the max-width of the media query by a few pixels, it should fix it.

Changing max-width works here as well, but keep in mind, that in real life projects the media width limits are usually set as they are for some reason, so changing them might change many other things as well.

True, but the breakpoints should be set based on things like the navigation and other global elements, not arbitrary numbers based on device resolutions (e.g. 768 for some tablet portrait widths).

Daniel Riches
Daniel Riches
19,847 Points

Thanks guys, I'm gonna experiment with this.