The margin-top property sets only the top margin but the margin property sets all four margins (top, right, bottom, left). Since you put margin after margin-top then all four margin properties are being set to auto and it is wiping out the previous margin-top property.