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 Unused CSS Stages Media Queries Device-Specific Media Queries

Timothy coxon
Timothy coxon
18,404 Points

Pixel Ratios Multi Choice Question

I just failed this test as I answered 4 as the number of css pixels display when the pixel ratio is 2. The correct answer according to the quiz is apparently 2. Surely if you double the pixel dimensions you are increasing the number of both horizontal and vertical pixels displayed? 1px * 1px = 1px total displayed 2px * 2px = 4px total displayed

2 Answers

Tom Bedford
Tom Bedford
15,645 Points

If you mean the question:

"If a device has a pixel-ratio of 2, then 1 CSS pixel is displayed as __ physical pixel(s) on screen."

I believe the correct answer is 2 as with CSS you are either specifying a width or height, not the area taken up by both.

e.g. on an iPhone 4+ with a width of 640px and a pixel ratio of 2, to target the full width you would use 320px.

So, one CSS pixel (in this case width) is displayed as 2 on the iPhone.

Timothy coxon
Timothy coxon
18,404 Points

Yeah kinda makes sense when you put it like that but the original question doesn't really mention anything along those lines. In the way it's the question is written out if you are looking at 1 css pixel on a 2 pixel ratio device you are actually seeing 4 physical pixels and not 2. I think I am just arguing semantics really but the question could be a little clearer on that front ;)