Question: when to use px em rem?
Answer: That is, If font-size of the root element is 16px then 1 rem = 16px for all elements. If font-size is not explicitly defined in root element then 1rem will be equal to the default font-size provided by the browser (usually 16px). When it comes to spacing and font-sizing, I prefer to use rem .