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 trialChristopher Mlalazi
Front End Web Development Techdegree Graduate 17,305 PointsHow do you determine Pixels value to be used
This is another question that is confusing me as we build our CSS. We have been giving images pixel values/size, like say 20px, 40px for this or that image. I am new to pixel measurements, and how do we determine the right size of pixels for out images for the website. I mean, in centimeters there is a ruler and I can visualize how long 20cm is, but how do you visualize pixels so as to give them the correct value/size?
I donβt know if my question is clear, but for example, this pane where I am writing this questions, if it were an image how would I know how many pixels it is? This is an important question for me and if it is not understood I can re-ask it. Thanking you in advance folk.
2 Answers
Sean Pierce Sumler
18,968 PointsHey Chris. I had a similar issue trying to visualize the size of x amount of pixels, too. One way I got around this was using percentages instead of pixels. Another way I was able to understand pixel size was simply playing around with the width and height of images, swapping out their values until I had reached a desired size.
As for the "right" size, that's completely up to you. After awhile, you'll learn how to balance out a site using appropriate measurements.
I hope this helps. -S
Christopher Mlalazi
Front End Web Development Techdegree Graduate 17,305 PointsThatβs a great way to tackle it Sean. Let me do it that way, thanks a lot!