+ 3
CSS Properties
Is there a difference between top,left,rigth,bottom properties and margin-top,margin-left etc.? Like I tried using them both and they had the same effect. I want to know if one is meant for a specific purpose or something
6 odpowiedzi
+ 2
The top, right, bottom, and left properties are generally used to move the element within whatever has been specified by the position property. The margin-left, margin-right, etc. properties are used to add a certain amount of space relative to the element, extending its box outwards.
Hope this helped! d:
+ 2
so you mean there can be only an effect for top, left, right, bottom if the position property of the element is specified?
+ 2
ohh okay thankyou for your time!
+ 1
Jax Wang Yep. They are quite highly dependant on it, so excluding it would render them useless
+ 1
Well Faisal is right if you take a look at CSS Box Model you'll note that margins are beyond reach of those simply top ,right, left,bottom things
0
No problem ;)