treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Should you round up a 3 digit EM ?

  • This might be a bit anal, but let's say you have an EM based layout, and the value for ex.
    p.foo {
    letter-spacing: 0.333em;
    font-size: 1.888;
    }

    Should you then round any of these up? To 0.334em and/or 1.889em?
  • I don't see why you should. According to this converter it doesn't make a difference anyhow http://pxtoem.com/
  • Yeah, I mean you shouldn't, right?
    But still, I swear I've seen it somewhere, and sometimes I wonder if rounding up certain EM's haven't made the browser "get it" right more often... If I could only remember in what browser, and what i did...

    And speaking of EM's, btw. Why is everyone complaining so much about the conversion work from PX?? It's fun! hehe. Math is my friend, today at least.
    No but seriously, it's not that hard I don't think, I really don't get everyone's beef. All it is, is simple logic. font-size: 1.5em (which is 15px) and you want the line-height to 21px?
    ( 1/15 ) * 21 = 1.4em - 'lil tip