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.

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;
}