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 trialMICHAEL P
5,191 PointsMy 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%; }
}
4 Answers
Kevin Korte
28,149 PointsI don't see where you've closed your first media query
Owa Aquino
19,277 PointsYep, 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
5,191 PointsThank you for helping me!
MICHAEL P
5,191 PointsIn 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
19,277 PointsYes that is just a note or comment. Like in htmls <!-- comment --> in css we use // or /* comment */
Cheers!
MICHAEL P
5,191 PointsThank you Owa Aquino! I am not able to select your answer as the "best answer", for some reason.
You really helped me out!
Cheo R
37,150 PointsCheo R
37,150 PointsAre you sure it's loading correctly? I've come to like using
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.