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

CSS How to Make a Website Responsive Web Design and Testing Adjust the Profile Page and Header

Tobi Ogunnaike
Tobi Ogunnaike
2,242 Points

In mobile view, text on About page is displayed to the right of picture instead of beneath it? Please help!

My workspace is here: http://teamtreehouse.com/workspaces/2738672#

I floated the picture to the left, and want a 2 column layout for desktop viewers but only one column on mobile.

However, in mobile view, the browser interpretes my code to have a 2 layout column such that the text is to the right of the picture.

How do I solve this? Thanks!

Abhijeet Das
Abhijeet Das
Courses Plus Student 3,158 Points

hello your work space link isn't working so I can't see the CSS, however try to give a display property blockon your text such as .column2 { display:block; } may be this one solve the problem.

Can you post your code? See the 'Markdown Cheatsheet' link around the post button for tips!

Tobi Ogunnaike
Tobi Ogunnaike
2,242 Points
@media screen and (min-width:480px){

    /**********************************
    TWO COLUMN LAYOUT for Contact page
    **********************************/
  #primary{
    width:50%;
    float:left;
  }

  #secondary{
    width:40%;
    float:right;
  }
}

/******************************************
 PAGE:PORTFOLIO (This makes 3 photos per row i.e. 3 column layout
*******************************************/
#gallery li{
  width:28.3333%;}

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

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

That's my code in my responsive.css file. Any idea what's going wrong? Thanks!!

Tobi Ogunnaike
Tobi Ogunnaike
2,242 Points
@media screen and (min-width:480px){

    /**********************************
    TWO COLUMN LAYOUT for Contact page
    **********************************/
  #primary{
    width:50%;
    float:left;
  }

  #secondary{
    width:40%;
    float:right;
  }
}

/******************************************
 PAGE:PORTFOLIO (This makes 3 photos per row i.e. 3 column layout
*******************************************/
#gallery li{
  width:28.3333%;}

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

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

That's my code in my responsive.css file. Any idea what's going wrong? Thanks!!

1 Answer

Abhijeet Das
PLUS
Abhijeet Das
Courses Plus Student 3,158 Points

hello mate I think you shouldn't use the float property on the profile-photo class in your mobile version, instead use display block on it.

.profile-photo{
  display: block;
  margin:0 5% 80px 0;
}

let me know if you still have the problem.

Tobi Ogunnaike
Tobi Ogunnaike
2,242 Points

Tried this, it worked. thanks. But I had already used 'display block' in main.css so I should have been working anyway!