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 trialMira Patronen
3,791 Points@media query 660 loses the whole header and navigation
After adding stuff under second media query my whole header and navigation disappear when screen is adjusted to larger than 660px. Whaaat? Here's my code https://w.trhou.se/guhohsp7yf
3 Answers
Michael Afanasiev
Courses Plus Student 15,596 PointsHello Mira,
Make sure you put your media queries at the bottom of your CSS and everything should be fine :)
Jennifer Nordell
Treehouse TeacherMichael is correct. Make sure your media queries are at the bottom. But even now, the navigation isn't really gone. It just happens to be mostly white text on a white background. If you hit CTRL + A or command+A you'll see what I mean.
CODY NUNEZ
2,828 PointsYeah I still don't understand. I know css is cascading but how can the media queries be at the bottom when they are the only ones in responsive.css?
Manasa Reddy Banala
Courses Plus Student 688 PointsCan you explain this?
alastair cooper
30,617 PointsYou have removed the background in the nav rule by setting it to none, so any background-colors or background-images are gone. You have a white screen where your header is. Your text is also white so you cannot see it even though it is still there. The header is still there as well. If you open your console (F12 on windows) and select the elements tab, click on the header tag and it will show in your browser. To prove the text is still there, alter it's color.
Mira Patronen
3,791 PointsMira Patronen
3,791 PointsHi and thank you for answering. What do you mean with media queries at the bottom? To me it seems that media queries are at the bottom of css since they are only thing in responsive.css or should something be added to main.css too?
CODY NUNEZ
2,828 PointsCODY NUNEZ
2,828 PointsYeah I still don't understand. I know css is cascading but how can the media queries be at the bottom when they are the only ones in responsive.css?
CODY NUNEZ
2,828 PointsCODY NUNEZ
2,828 PointsMy Responsive.css
@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%; }
#logo { float: left; margin-left: 5%; text-align: left; width: 45%;
}
h1 { font-size: 2.5em; }
h2 { font-size: 0.825em; margin-bottom: 20px; }
}