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

Jay Guillermo
Jay Guillermo
1,305 Points

When I make window smaller, the Contact layout stays in 2 columns instead of going to 1 column for mobile.

I have added the media query:

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

}

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

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

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

However, when I make window smaller, the "Contact" page stays in 2 columns instead of going to 1 column for mobile.

4 Answers

Hi Jay,

You made a very simple mistake :)

you have put a condition that a code should execute if the condition of the media query is met (i.e minimum width of 480px) but when u put this condition only the code inside the curly brackets { //code goes here } will get executed

summary : put the code inside { } @media screen and (min-width: 480px) { // code here }

note : its actually a basic programming concept that when you write a condition and its true the code inside the curly bracketwill execute :)

Christopher Parke
Christopher Parke
21,978 Points

Hi Jay,

You should put the code below the media query inside it. Then you should make the primary and secondary elements have a width of 90% and display:block; as their display property

Christopher Parke
Christopher Parke
21,978 Points

primary,

secondary {

display: block; Width: 90%; }

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

primary {

    width: 50%;
    Float: left;
 }

secondary {

    width: 40%;
    float: right;
 }

}