search

Home  >  Q&A  >  body text

javascript - Why should margin be removed when converting floating layout to positioned layout?

for(var i=0;i<aLi.length;i++){
                aLi[i].style.position = 'absolute';
                aLi[i].style.left = arr[i][0] + 'px';
                aLi[i].style.top = arr[i][1] + 'px';
                ***aLi[i].style.margin = 0;***
            }
PHP中文网PHP中文网2809 days ago636

reply all(1)I'll reply

  • typecho

    typecho2017-07-05 10:41:16

    What you gave is not enough to make a judgment. I suggest you add it to see what the difference is

    reply
    0
  • Cancelreply