Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Hear, hear! :) I'm really happy to see this get to the front page.

But why pixels (px) and not points (pt)?

I made a site using 12pt text and it looks good everywhere (ipad, iphone, chromebook, linux, windows, mac).

I suspect 16px is going to look too small on a Retina Macbook (I don't own one, so I wouldn't know).



From the CSS specification:

px: pixel units — 1px is equal to 0.75pt.

[...]

The reference pixel is the visual angle of one pixel on a device with a pixel density of 96dpi and a distance from the reader of an arm's length. For a nominal arm's length of 28 inches, the visual angle is therefore about 0.0213 degrees. For reading at arm's length, 1px thus corresponds to about 0.26 mm (1/96 inch).

http://www.w3.org/TR/CSS21/syndata.html#length-units


Thanks! I didn't know that a CSS px wasn't the same as a screen pixel.


Also, on Retina displays, OS X browsers automatically double pixel dimensions.

By default, something declared as 16px is actually rendered as 32px (but sharper).


Points are mostly in the CSS spec for print media rather than screen. Use proportional units (em, keyword, percentage) or px for screen.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: