Blankasaurus Blankasaurus - 1 year ago 102
CSS Question

CSS: Top vs Margin-top

I'm not sure if I fully understand the difference between these two.

Can someone explain why I would use one over the other and how they differ?

Answer Source

top is for tweak an element with use of position property.
margin-top is for measuring the external distance to the element, in relation to the previous one.

Also, top behavior can differ depending on the type of position, absolute, relative or fixed.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download