Consider element's margin when resizing