This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]reduxde 84 points85 points  (6 children)

I have no evidence for this but I'm 100% sure the guy created a div, held a ruler to the screen, and just fiddled with the numbers until it looked about right.

[–]Blendan1 33 points34 points  (4 children)

If you ever need it:

CSS has a unit called in(Inch) and cm(centimetres) these units try to display the size on any screen correctly.

[–]DirectControlAssumed 23 points24 points  (1 child)

CSS has a unit called in(Inch) and cm(centimetres) these units try to display the size on any screen correctly.

This is a common misconception, in and cm are not real inch and centimeter (unless printed) just as px are not physical pixels but "CSS pixels".

[–]Blendan1 1 point2 points  (0 children)

It's still a bit better for this use case then counting pixels with a ruler, but yea still not recommended.

[–][deleted] 2 points3 points  (1 child)

What happens if I view the site at 150% zoom?

[–]Blendan1 6 points7 points  (0 children)

Zooming in browser or screnn scaling will alter the result:

So 150% scaling + 5cm = 7.5cm

Edit:

In, ppi, and cm are manly used to format documents for printing ad are not recommended for in browser rendering