Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

Something is wrong with my navigation when resizing browser

here are the images of the website behaviour

http://imgur.com/a/AJiVf

scroll down to see all images.

and here is the code for my media query

gallery li:nth-child(2n+1) {

clear:left; } @media screen and (min-width: 480px) {

/**************************************** TWO COLUMN LAYOUT *****************************************/

#primary { width: 50%; float: left; }

#secondary { width: 40%; float: right; }

/**************************************** PAGE: PORTFOLIO *****************************************/

#gallery li { width: 28.3333%; }

#gallery li:nth-child(2n+1) { clear: none;

}

#gallery li:nth-child(3n+1) { clear:left; }

  /****************************************
      PAGE: ABOUT
      *****************************************/

.profile-photo { float: left; margin: 0 5% 80px 0; }

}

@media screen and (min-width: 660px) {

 /****************************************
HEADER
 *****************************************/



nav {
display: inline-block;
  background: none;
  float: right;
  font-size: 1.125em;
  margin-right: 5%;
  text-align: right;
  width: 45%; 
}

#logo {
 float: left;
  margin-left: 5%;
  text-align: left;
  width: 45%;
}

h1 {
 font-size: 2.5em;    
}

h2 {
  font-size: 0.825em;
  margin-bottom: 20px;
}

header {
  border-bottom: 10px solid #599a68;
  margin-bottom: 65px;
}

Just tell me if you need the codes for my "main.css" or "index.html"

2 Answers

A quick and easy way is to just add white-space: no wrap;

nav {
  display: inline-block;
  background: none;
  float: right;
  font-size: 1.125em;
  margin-right: 5%;
  text-align: right;
  width: 45%; 
  white-space: nowrap;
}

now i got rid of the problem when the browser is half size,

but the links still wraps around when the browser is the smallest

i tried to add a white-space: nowrap inside the other media query but it didnt help any ideas?

Just saw that when i added the nowrap to the nav selector, now my head border, is cut off at the "other link"