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

glenn romaniuk
glenn romaniuk
33,659 Points

media query to target windows surface pro

surface pro spec's screen height: 720 screen width: 1280 device pixel ratio: 1.25

example:

/* surface pro ----------- */ @media only screen and (min-device-width : 720px) and (max-device-width : 1280px) {

  body{ background-color: black; }

}

does not work

2 Answers

Sam Deighton II
Sam Deighton II
25,602 Points

Not sure if this is entirely correct but an idea. Im not an expert at all Check your code (min-device-width : 720px) should be (min-device-height : 720px) Also maybe try it without the only keyword.

glenn romaniuk
glenn romaniuk
33,659 Points

good eye i played around with the surface a bit more weird device if i use the max-device-height of 1280px then i'm able to direct a media query to it. thats backwards as you'd think it'd be the width a compound test of max-device-height of 1280px and max-device-width of 720px does not work. Bizzare. I'll keep u posted.