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) Understanding Values and Units Pixel Units

Aaron Coursolle
Aaron Coursolle
18,014 Points

So pixels are absolute, and yet they are not?

So from what I understand from the lesson, pixels do not scale based on screen size, but they scale based on scale density. If I create a background image in an editor, how will I know in the css how much room to give it?

3 Answers

Aaron Coursolle
Aaron Coursolle
18,014 Points

I think so, but I've always assumed that pixels were the most absolute measurement available.

Aaron Coursolle
Aaron Coursolle
18,014 Points

Ignore the option to create different media queries for different screen resolutions. What I'm seeing in the link, is to create the image at 2X by 2Y. But in the CSS, declare everything at a 1:1 ratio. I'm only rephrasing the advice presented in the link in a way I can easily remember.

Will this allow a background image to be seen, in its entirety, regardless of what monitor a person is using; even if the user has to horizontally scroll it? Or will some monitors cut the image in half?

Do you mean what width and height you give the image in css for a background image?