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 trialPaul Topham
110 Pointswhat am i doing wrong here? media query not responding
/* Media Queries ------------------ */
@media all (max-width: 960px) { body { background: royalblue; }
p { color: white; }
}
@media all (max-width: 480px) { body { background: darkred; } }
1 Answer
Bryan Peters
11,996 PointsTake out "all" and it works fine. Media type "all" is implied if you don't specify another value.
alternatively use "and" like this:
@media all and (max-width: 480px)
Paul Topham
110 PointsPaul Topham
110 Pointsunfortunately that didnt work either
/* Media Queries ------------------ */
@media (max-width: 960px) { body { background: royalblue; }
}
@media (max-width: 480px) { body { background: darkred; } }
@media (min-width: 481px) and (max-width: 700px) { body { background: seagreen; } p { color: white; } }
Bryan Peters
11,996 PointsBryan Peters
11,996 PointsCheck syntax for any css above your media queries. If you have any syntax errors, the rest of the css doesn't process. The code you posted works fine for me. If you are still having issues, post the full css.
Paul Topham
110 PointsPaul Topham
110 Pointsspot on with the syntax check! the float clearfix didnt have a closing bracket on it! i feel such a fool! thanks for that bud!