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

Rahul Chakravarti
Rahul Chakravarti
1,119 Points

3rd pic having issues

@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.33%; }

#gallery li:nth-child(4) {

}

}

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

}

THIS IS MY CSS. THE PROBLEM IS WHEN I RESIZE THE SCREEN THE 1ST IMAGE'S CAPTION DOESN'T LET THE THIRD IMAGE TO ROLL UNDER IT RESULTING IN A WHITE SPACE BELOW THE FIRST IMAGE IN A 2 IMAGE GRID.THE THIRD IMAGE SHIFTS BELOW THE SECOND IMAGE AND A WHITE SPACE APPEARS BELOW THE FIRST IMAGE. HOW CAN I FIX THIS???

1 Answer

Felipe Belinassi
Felipe Belinassi
1,567 Points

Hello Rahul. I didn't understand exactly what's happening. Could you post your html/css file, or a print screen of your site?

Also, your nth-child is wrong, you forgot the 'n' after the number inside the parenthesis. Like this:

#gallery li:nth-child(4n) {
  clear: left;
}