News for hackers. Stuff that matters.
Re:CSS Zen Garden relaunched by jimktrains2 on Sunday July 21, 2013 @09:19AM (#6078696)
Aside: Why do people use px for text and not pt? pt seems like it'd be much more portable.
Re:CSS Zen Garden relaunched by blauwbilgorgel on Sunday July 21, 2013 @12:11PM (#6079229)
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

Re:CSS Zen Garden relaunched by jimktrains2 on Sunday July 21, 2013 @12:31PM (#6079307)
Thanks! for all the information.
Re:CSS Zen Garden relaunched by onli on Sunday July 21, 2013 @11:54AM (#6079149)
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.

Re:CSS Zen Garden relaunched by jimktrains2 on Sunday July 21, 2013 @12:30PM (#6079302)
The OS and application would know the dpi and hence could convert pixels to pts I thought.
Re:CSS Zen Garden relaunched by onli on Sunday July 21, 2013 @01:48PM (#6079569)
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.