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

CSS CSS Basics (2014) Enhancing the Design With CSS Media Query Basics

Julie Maya
Julie Maya
14,666 Points

Why the "max-width" is red/showed error in media element??

It's also shown on the video clip. Why??

1 Answer

Samuel Key
Samuel Key
3,310 Points

I think it's because he didn't give it a media type. The error goes away if you do something like this:

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

}

Perhaps if media type is left blank it defaults to 'all' but then I don't know why it would suggest an error. Here's a link explaining media queries and a list of media types: http://www.w3schools.com/cssref/css3_pr_mediaquery.asp

huckleberry
huckleberry
14,636 Points

This is correct. While it will default to all, it's simply letting you know that it would prefer if you actually put in the 'all' and not leave it blank.

Cheers,

Huck - :sunglasses: