1

I'm asking myself a question, and you sure will have an answer leading me to the right path.

As of today, CanIUse indicates more than 97% of browsers support Rem unit, so I think we can safely use it. But do you think it's a good option to use it for everything (fall font properties, positions, margins and paddings, ...) ?

Do you think we still need pixels for some elements ?

Thank you !

P.S. : I don't try to go in another "Rem vs Em" debate ; I find Rem unit more convenient, though I'm always listening for advices and opposite ways of thinking ;)

Fl-0
  • 27
  • 8
  • Why not use em? I been using rem on fonts past two projects at work. – Dejan.S Aug 05 '16 at 13:52
  • This feels very "what do you think?" for a Stack Overflow question. Are you looking for situations where this may break? Or just a general opinion on using Rem everywhere? – DBS Aug 05 '16 at 13:53
  • @Dejan.S I find it more convenient to rely on root size for all my document. Your Rem experience was bad ? – Fl-0 Aug 05 '16 at 14:01
  • @DBS : It's kind of both, actually. I know it's not the best place to ask only for opinions, but by posting here I expected some cases of people using Rem everywhere that may, or not, confirm it's not a bad way to go. Be warned of some situations where it may break, as you said. – Fl-0 Aug 05 '16 at 14:01
  • Won't somebody think of IE?! – William Isted Aug 09 '16 at 09:47

1 Answers1

0

Actually, as of the behaviour of modern browsers and the fact, that the px unit isn't actually a physical one my opinion is use to use px everywhere, as many elements such as img do use that originally. Using the same overall is making life much easier.

Beside I recommend you to read the following answer on the question for more details. (Not only because it's sharing my opinion ;) )

https://stackoverflow.com/a/11803273/2538750

Community
  • 1
  • 1
Flowkap
  • 729
  • 6
  • 16
  • Personally I barely use `px` and in general go for `em` or `rem`. `px` for things like border-width and media-query breakpoints (although media-queries work with rems well too). So I think this is very much about preferences... – MMachinegun Aug 05 '16 at 14:30
  • 1
    @marczking Thank you for answer ! – Fl-0 Aug 09 '16 at 09:32