Fixed a bug when adding margin or padding to elements