Live data from Hacker News

Em Baseline Generator

joshnh.com

1–10 of 29 posts

Re: Em Baseline Generator

#4

The letters are hanging in the air, i think a good demonstration would show the baseline of the letters to coincide with the line pattern! http://upload.wikimedia.org/wikipedia/commons/3/39/Typograph...

Hi, creator here. Unfortunately that's not how CSS works. See here for more information: http://joshnh.com/2012/10/12/how-does-line-height-actually-w...

Re: Em Baseline Generator

#6
post #4

The letters are hanging in the air, i think a good demonstration would show the baseline of the letters to coincide with the line pattern! http://upload.wikimedia.org/wikipedia/commons/3/39/Typograph...

Hi, creator here. Unfortunately that's not how CSS works. See here for more information: http://joshnh.com/2012/10/12/how-does-line-height-actually-w...

I read your article. But i am still wondering why you cant shift the pattern so that the lines really line up with the baseline. You can influence the leading via margin or padding and the line-height property, right?

Re: Em Baseline Generator

#8
post #4

Earlier quoted context omitted.

Hi, creator here. Unfortunately that's not how CSS works. See here for more information: http://joshnh.com/2012/10/12/how-does-line-height-actually-w...

I read your article. But i am still wondering why you cant shift the pattern so that the lines really line up with the baseline. You can influence the leading via margin or padding and the line-height property, right?

Absolutely, you can hack it on a very individual basis, but this introduces some major problems. For instance, browsers and operating systems all render fonts differently, and as the web is fluid by nature, simply having a sentence break to the next line can be an issue. Also, it can be incredibly different based on the typefaces you are using.

Re: Em Baseline Generator

#9
post #5

Why do I need to use em? I thought browsers handled things like zooming on their own nowadays. What's wrong with px?

With em you define a base font-size in px. And then you express multiples of the base in em, instead of multiplying manually

Re: Em Baseline Generator

#10
post #5

Why do I need to use em? I thought browsers handled things like zooming on their own nowadays. What's wrong with px?

Ems are more versatile. When increasing the size of all fonts at a particular breakpoint for instance. Instead of having to adjust each font-size property individually you can simply change the font-size of the root element.
Post reply on HN