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

Ashley Hermann
Ashley Hermann
1,335 Points

About photo remaining left even in mobile view

I just added the code on my responsive css that will float my profile photo on my about page to the left when in larger screen sizes, however it is floating it left in all screen sizes now, even the mobile. My text is also wrapping around the bottom of my picture. I'm guessing I need to add a larger bottom margin to fix the text wrap issue is that correct? Now how do I correct the float left in mobile view issue as well?

https://w.trhou.se/c8rsi0oik4

2 Answers

Curtis Murley
Curtis Murley
2,766 Points

Hi again Ashley,

Your responsive.css file should be broken up by two media queries. min-width:480px and min-width:660px. Make sure that ALL selectors are within either of the two queries. It would appear that your min-width:480px queries closing curly brace is closed early and there are selectors outside of the two queries.

This is why certain elements are behaving the way they are at all times rather than at certain times. Your current layout is more like this...

@media screen and (min-width: 480px) {     // <-- Your first queries opening brace is here 

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

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

  #secondary {
    width: 40%;
    float: right;
  }
} // <--     Your first queries closing brace is here 

 //
 // do these at all times
 .profile-photo {
  float: left;
  margin: 0 5% 80px 0;
}
 //
 //

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

 // do these while in desktop view

}

Thank you!

I was having the same problem, and this fixed it!

Tiffany McAllister
Tiffany McAllister
25,806 Points

Your min-width: 480px media query is closed early. The curly bracket is after the #secondary rule when it should be after the .profile-photo rule. Hope that helps!