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

I think there's something wrong here

I followed up the videos up to this point and noticed that when I refresh the page, it just doesn't behave like the one in the video. So I checked again the video and my css and they are the same.

Nick, the thing is that when I re-size my browser window to full size, my Portfolio images are on two columns and when I re-size it to a minimum width, it's on three columns. So I switched the css for the 480px media query with the 660px and it works. I'm guessing it's logical that the 3 column layout be rendered on a large screen, while the two column one be rendered on a small mobile screen.

You might notice I added the "width: 45%" to the first 480px media query, but later commented it out because I remembered what the "C" from css stands for. :))

I encountered the same issue with the profile pic on the about page, so I moved the css for the 660px media query part, and it works "like advertised". :)

Here's my current responsive.css file:

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

/***************
TWO COLUMN LAYOUT
****************/
/*
    #gallery li {
 width: 45% 
}
*/

  #primary {
    width: 50%;
    float: left;
      }
  #secondary {
    width: 40%;
    float:right;
  }
}

/***************
3 * 5 = 15
100% - 15% = 85%
85 / 3 = 28.33333333333
****************/

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

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


  #gallery li {
 width: 28.3333% 
}

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


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

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

This is my current responsive.css file and my page works like the one you refresh in your video.

1 Answer

Justin Hunter
PLUS
Justin Hunter
Courses Plus Student 11,484 Points

Emanuel, it sounds like you may have solved your problem, but just in case: in the tutorial, the break from two columns to three columns is actually at the 480px mark. The reason for this is so that when a mobile phone is held in landscape mode, it will display three columns. 480px is a good break point for landscape on mobile devices.