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 jQuery Basics (2014) Creating a Mobile Drop Down Menu Perform: Part 3

Lanie Williamson
PLUS
Lanie Williamson
Courses Plus Student 11,390 Points

Why is part of the media query highlighted in red?

At around 2:40 in this video, in the media query the "min-width", "and", "max-width" and "{" are highlighted in red. Why? It may be obvious but I have not been able to find an answer. Thanks!

2 Answers

rydavim
rydavim
18,814 Points

The syntax highlighting for media queries in workspaces seems to be a bit wonky in that instance. Basically, the red is flagging it as incorrect in some way when the code is fine. You can safely ignore it in this context.

EDIT: Okay, it turns out that workspaces really wants you to include the media type and that's why it's flagging it as incorrect. It's more of a 'best practices' flag than a hard error.

This code will be flagged red in Workspaces:

@media (min-width: 480px) and (max-width: 720px) {
}

This code will not be flagged red in Workspaces:

@media screen and (min-width: 480px) and (max-width: 720px) {
}
Lanie Williamson
Lanie Williamson
Courses Plus Student 11,390 Points

Thanks - that makes sense. I knew it was working correctly since it was on Andrew's video as well I just was trying to understand it. Appreciate the answer!

Text editors often highlight code that they do not recognize. That may or may not be correct, depending in the editor. In this case the editor does not recognize the code even though it is correct.