Hacker News new | ask | show | jobs
by jimktrains2 4711 days ago
Aside: Why do people use px for text and not pt? pt seems like it'd be much more portable.
2 comments

I think relative font-sizing with "em" and "rem" [1] is a popular and good choice these days. "em" has been popular since 2004 after an article by Rutter [2].

IE9- (and Android 1.6-) didn't scale/zoom well when the font was set in px. But using px was widespread despite these (and other) cons because it was easy, reliable and consistent to implement across browsers. [3]

Pt (point type) are only for printer style sheets [4], not screen style sheets. Using them for screen styles is not-done and doesn't make much sense. [5]

[1] http://snook.ca/archives/html_and_css/font-size-with-rem

[2] http://clagnut.com/blog/348/

[3] http://alistapart.com/article/howtosizetextincss

[4] http://css-tricks.com/css-font-size/

[5] http://style.cleverchimp.com/font_size/points/font_wars.GIF

Thanks! for all the information.
Why would it be? 1/72 of an inch has no corresponding value on a monitor.

http://stackoverflow.com/a/3557279/2508518 says it in a good way.

The OS and application would know the dpi and hence could convert pixels to pts I thought.
That wouldn't help. Without wanting to go too deep into OT-territory:

Even if the DPI could be known (and afaik normally it isn't, it is just set to a value) and it would be possible to convert in into real inches (btw, I have no idea how big that is in real units) to be displayed on a monitor, how would a designer know how big any element, even text, should be? It depends on the available space, which depends on the size of the monitor/the size of the window.

To think about how absurd that would be, try to find a situation where someone would say "this heading should be 2 cm tall".

px as size lead to the same problem with the available space, but they at least correspond to the resolution.