Home  >  Q&A  >  body text

What is the difference between left and margin-left in this?

left: 20px; and margin-left: 20px;

What’s the difference?

人事易分°人事易分°2321 days ago1543

reply all(1)I'll reply

  • 无忌哥哥

    无忌哥哥2018-07-04 16:18:08

    left:20px is used for positioning. It must have the position attribute in front. margin-left:20px describes the outer margin. The left distance of the current grid is the width of the previous grid. Try it yourself,

    reply
    0
  • Cancelreply