I was trying to learn about using Rem and Em that which one is suitable with margin, padding or dimension (width or height) and I learned that Em is often used for spacing that uses standard font sizes in Unit of measurement e.g., margin size between heading and paragraph and padding in button depend on font-size in button. For the unit Rem, it is a size measurement that relative on the main font size of the page used with Margin Padding and Dimension, depending on what or when it is used, e.g., padding of division tag contain a content or margin between element and element.
If you have any suggestions or corrections, please let me know. Thank you.