px vs em revisited

Out of context: Reply #2

  • Started
  • Last post
  • 22 Responses
  • ETM0

    A lot of people I have noticed are getting away from it and back to pixels units again. Most devices and browsers have become quite good at knowing how to scale most units be it px or em etc.

    Personally, I do use it for text, setting the baseline in my CSS reset as 16 px is 1 em (divides by 4 so good for 0.25 point increments).

    In layout, I typically only use ems for vertical spacing around text (top, bottom etc.) and use px for left and right measurements. My thoughts are that if someone does scale the text, I may not want by margins along the side to get any bigger and squish things, but I do want, say the distance between paragraphs to scale with the text size change. A 1em gap between paragraphs will always then stay at the same ratio. If it was fixed at 10px and the browser or device left that as is, then the paragraphs could crowd.

    • after reading this i feel like i owe you something. so fucking informative.kingsteven
    • That's a good point. Never done it that way before.nocomply

View thread