0

i dont underatand what the diffrent between margin-top and top

if i put top:10px or margin-top 10px the result is same. p{ position:relative ; padding:20px; max-width:40px; border-style:solid ; top:10px; }

1st Oct 2016, 8:53 PM
ran gantz
ran gantz - avatar
2 Answers
+ 4
top is only for relative and absolute position. it moves all block without any effects on parent or changing size of block. margin works everywhere and may change size of block depending on location of other elements. to some up, they will work differently if there are a lot of blocks on the page
1st Oct 2016, 9:18 PM
ŠšŠ¾Š½ŃŃ‚Š°Š½Ń‚ŠøŠ½ ŠšŠ¾Š»Š¾Š±Š¾Š²
ŠšŠ¾Š½ŃŃ‚Š°Š½Ń‚ŠøŠ½ ŠšŠ¾Š»Š¾Š±Š¾Š² - avatar
+ 1
Š§Ń‚Š¾ этŠ¾?
2nd Jun 2017, 3:01 PM
Atham
Atham - avatar