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

Media Queries

Can someone please explain what the 'only' logical-operator does in a Media query.

Thanks in advanced.

1 Answer

"Only" is used for hiding stylesheets from older user agents. The media type "only" does not exist in older browsers so therefore, it will not recognize the stylesheet.

There are many different types of media queries that are used for printing and mobile design. I tend to put "only" in my breakpoints. It doesn't really hurt anything. Especially of your site is so modern that it's using experimental CSS3 properties that aren't supported by older browsers.

Thank you!:)