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

erdragerdragsson
Courses Plus Student 5,887 PointsImages and navigation are placed wrong when making browser smaller!
Hey, when i make my browser smaller the navigation and images are rezising heres a picture of it
4 Answers

B Nawaz
13,402 PointsI'd say make sure that the nav elements are display: inline-block and that you give the images some margin.
This initially looks like maybe your media queries are being applied? Could you paste those up here so we can have a look?
Are you using min-width or max-width in your media queries?

erdragerdragsson
Courses Plus Student 5,887 Pointsheres the media querie code
the thing i have the most problem with is the navigation links, because they change places
the images does not overlap eachother anymore, because i changed border size on them
look at these images and see the behaviour of my website
http://imgur.com/a/AJiVf (scroll down to see all of the images)
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;
}

B Nawaz
13,402 PointsOk cool,
Have you tried:
#gallery li:nth-child(4n) { clear: left; }
/************************************************** PAGE: ABOUT **************************************************/
.profile-photo { float: left; margin: 0 5% 80px 0; }
As opposed to your current #gallery li:nth-child(3n + 1) rules? Try the replacing with the code above and see how that looks.
Hope that helps,
Let me know how you get on!

erdragerdragsson
Courses Plus Student 5,887 Pointsi replaced the 3+1 with 4n, but it didnt help, hmm, any more ideas`?
i still have the problem with the links

erdragerdragsson
Courses Plus Student 5,887 Pointsive looked on many different sites, about how to get this fixed, but i cant seem to find any solutions ;/ hmmm
erdragerdragsson
Courses Plus Student 5,887 Pointserdragerdragsson
Courses Plus Student 5,887 Pointsand heres my code for Main.css index.html and the media@ css
body { font-family: 'Lora', serif; ```
}
html { min-height: 98%; border-bottom-color: #599a68; border-bottom-style: solid; border-bottom-width: 40px;
}/*Makes the whole div section, have max-width of 940px, with margin 0 , auto and a padding of: 0, 5% */
#wrapper { max-width: 940px; margin: 0 auto; padding: 0 5%;
}/makes the underline disapear, and while clicking, you get pointer/
a { text-decoration: none; cursor: pointer;
}img { max-width: 100%;
}h3 { margin: 0 0 1em 0;
}/**************************************** HEADING *****************************************/
/* margin moves it 30px to the bottom*/
header { float: left; margin: 0 0 30px 0; padding: 5px 0 0 0; width: 100%;
}
/Makes the text in the header align center, and with margin 0/
#logo { text-align: center; margin: 0; width: 50%;
}h1 { font-family: 'Sansita One', cursive; margin: 15px 0; font-size: 2.0em; font-weight: normal; line-height: 0.8em; text-shadow: 2px 1px 1px black;
}/**************************************** NAVIGATION *****************************************/
/**************************************** FOOTER *****************************************/
/**************************************** PAGE: PORTFOLIO *****************************************/
#gallery { margin: 0; padding: 0; list-style: none;
}#gallery li { float: left; width: 45%; margin: 2.5%; background-color: #f5f5f5; color: #bdc3c7;
}#gallery li a p { margin: 0; padding: 5%; font-size: 0.8em; color: #898989; text-shadow: 0.2px 0.2px 0.1px grey;
}/Change the look of the images in portfolio/
.images { border-radius: 5px; border: 10px solid; border-color: lightgreen;
}/**************************************** PAGE: ABOUT *****************************************/
.profile-photo { display: block; max-width: 150px; margin: 0 auto 30px; border-radius: 100px; border: 7px solid lightgreen;
}/**************************************** PAGE: OTHER *****************************************/
INDEX HTML