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

MICHAEL P
MICHAEL P
5,191 Points

My responsive.css does not work when I load it. Can someone please take a look? I would really appreciate it.

@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.3333%; }

gallery li:nth-child(4n) {

clear: left; }

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

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

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

/************** HEADER ****************/

nav { background: none; float: right; font-size: 1.125em; margin-right: 5%; text-align: right; width: 45%; }

}

Cheo R
Cheo R
37,150 Points

Are you sure it's loading correctly? I've come to like using

* {
  border: 1px solid red;
}

to check if the file's actually loading because it sets a red border around all elements. Often times when something is not being applied (or entire css is not loading) is because I misspelled something.

4 Answers

Kevin Korte
Kevin Korte
28,148 Points

I don't see where you've closed your first media query

Owa Aquino
Owa Aquino
19,277 Points

Yep, maybe that's why it's not rendering. Try this:

@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.3333%; }

gallery li:nth-child(4n) {

clear: left; }

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

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

} // closing media query here.

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

/************** HEADER ****************/

nav { background: none; float: right; font-size: 1.125em; margin-right: 5%; text-align: right; width: 45%; }

} // closing media query here.

Cheers!

MICHAEL P
MICHAEL P
5,191 Points

Thank you for helping me!

MICHAEL P
MICHAEL P
5,191 Points

In that last part where you typed "} // closing media query here. "

Is that just a note for me to understand better? Or is the proper syntax that I should follow?

Owa Aquino
Owa Aquino
19,277 Points

Yes that is just a note or comment. Like in htmls <!-- comment --> in css we use // or /* comment */

Cheers!

MICHAEL P
MICHAEL P
5,191 Points

Thank you Owa Aquino! I am not able to select your answer as the "best answer", for some reason.

You really helped me out!