Well, firstly, yes, I read a lot of articles ( Should I use px or rem units in my CSS? ) And forums about that.
I know that 1px is not a physical pixel, but a CSS pixel, and rem is basically the same as em , but it refers to the root element (hence r in rem-root), rather than the parent element. em itself is equal to the size set in the document, and it is popular for its scalability compared to a pixel that cannot be scaled.
In all articles I read that everyone loves rem, and should be used for font-size in a modern browser, but also use px as a rollback for IE8 and below. I see that the main reason people use rem is because the size scales better and is more mobile. Now I unexpectedly read articles that say that all modern browsers support viewport , so scalibilty is no longer a problem.
Then I read to convert rem to px correctly and vice versa, we can use html { font-size: 62.5%; } html { font-size: 62.5%; } which then turns 1rem into 10px.
So, after all this confusion, if scalibilty is not a problem due to viewports, but 1rem is converted to 10px via html 62.5%, plus I will use the pixels back anyway, then why use rem in the first place, and not just stick to the pixel? I no longer see the benefits of using rem .
Or did I miss some important rem advantage?
source share