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

Gabriel Gutierrez
Gabriel Gutierrez
2,180 Points

An Issue with media query

I'm well underway in creating my website and have been trying to create a breakpoint that is ultimately not working.

The following code isn't creating a breakpoint on either IE or Chrome: @media (min-width: 501px) { /css/}

Research has told me to try messing with a <meta> tag which just seems to make things worse. I've also tried specifying 'screen' and/or 'print' into the code nut that doesn't help either.

1 Answer

Stephan Olsen
Stephan Olsen
6,650 Points

Use this syntax instead. Also keep in mind that min-width means the styling inside will only take effect if the screen is wider than 501px, where as if you use max-width, it will take effect if it is lower.

@media screen and (min-width: 501px) {
    // css
}