CSS line-height does not need a unit
In case you didn’t already know, the CSS property
line-height does not need a unit. Eric Meyer explains the details in Unitless line-heights.
I knew about this, but I wasn’t quite aware of the difference between specifying a value and not. I did notice that I sometimes would get different results, but thought it had to do with browser quirkiness. Looks like I was wrong there.
Oh, a small tip: to avoid triggering a validation error when you specify
line-height:1.0 instead. Both are correct, but the CSS validator is buggy and doesn’t know that.
- Previous post: Win a copy of Getting Real
- Next post: Evaluating website accessibility part 3, Digging Deeper
Subscribe / follow
DreamHost web hosting
Use the promo code 456BEREASTREET3 to save USD 20 when you sign up for DreamHost