add the margin to the correct element