Click to See Complete Forum and Search --> : how to measure distance in pixels ?


manishrathi
06-30-2009, 12:14 PM
When I mention "left : 100px" in style, how much distance would that be ?

aj_nsc
06-30-2009, 12:33 PM
I would say about 100 pixels from the left.....

Not sure exactly what you mean but a pixel cannot be directly translated to a unit of length on it's own unless you know the resolution and dimensions of the screen where the pixel is contained.

A pixel is a relative unit, not an absolute one (like mm or in)

6StringGeek
06-30-2009, 06:06 PM
100 pixels equals (approximately...at least on my computer):

1 1/8 inches at 1440x900
1 1/4 inches at 1280x768
1 5/8 inches at 1024x768
2 inches at 800x600

manishrathi
07-03-2009, 02:53 PM
Not sure exactly what you mean but a pixel cannot be directly translated to a unit of length on it's own unless you know the resolution and dimensions of the screen where the pixel is contained


So how to use pixels as a measure of length ? When I check the properties of the computer and look in Display properties, I see screen resolution as
1280 by 1024 pixels. So how to measure length from this ? Does 1280 specify that there are 1280 pixels on trhe width of the computer ? Then divide the a280 by the width in inch and that will give the number of pixels width wise ? After that we can use these pixels as the unit of measure ?

tracknut
07-03-2009, 02:56 PM
Yes you can do that, as long as all of the viewers of your web site are using the same resolution & size monitor, and none have "zoomed in" or "zoomed out" on the site (for example if they have poor eyesight). So really, this method of measurement is not too practical in real life.

Dave

PierceMoore
07-05-2009, 01:21 PM
Depending on what browser you are using (hopefully Firefox), there is an incredible FF extension called "MeasureIt" that I absolutely swear by.

https://addons.mozilla.org/en-US/firefox/addon/539

It allows you to create and drag a measuring box across the screen, to see just how big things are.

I will never use a browser for development that I cannot use this plugin in.


Pierce

avantewebdesign
07-06-2009, 05:35 PM
This article talks about two excellent pixal rulers: http://developersbible.com/?p=33

One is a firefox add-on, the other is a Windows program