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 CSS Basics (2014) Enhancing the Design With CSS Adjusting the Layout with Media Queries

Rifqi Fahmi
Rifqi Fahmi
23,164 Points

how to define pixel based on screen resolution ?

how to define pixel based on screen resolution with windows resizer ? for example let we take the viewport screen resolution is 1200 x 911, how much the pixel?

Shezan Kazi
Shezan Kazi
10,807 Points

Hi,

what exactly are you trying to achieve?

4 Answers

Shezan Kazi
Shezan Kazi
10,807 Points

Oh I see. So for this you need to know, that the first value (i.e. 1200) is always the width. The second value (i.e. 911) is the height. Does this help?

Rifqi Fahmi
Rifqi Fahmi
23,164 Points

so if it's viewport width is 1200. In media query if it want to take effect on screen width 1200 or more narrowly I must set the code like this : @media (max-width: 1200px) {} ???

Rifqi Fahmi
Rifqi Fahmi
23,164 Points

I want to set the pixel in media query

Shezan Kazi
Shezan Kazi
10,807 Points

if you want screen width 1200 or more you need min-width.

Rifqi Fahmi
Rifqi Fahmi
23,164 Points

@media screen (min-width: 1200px) {} like this?