With reference to this, if I want to align a div
to left by 20px
, I can use both padding-left
or margin-left
. Which one is preferred and in which case?
<div style="padding-left: 20px;">
Move me by 20px left!
</div>
<div style="margin-left: 20px;">
Move me by 20px left!
</div>