*{ margin:0; padding:0; box-sizing:border-box; -moz-box-sizing:border-box; -webkit-box-sizing:border-box; } div{ width: 100%; height: 30px; border:4px solid #000; margin:20px 20px 30px; margin-right:20px; } 
 <div></div> <div></div> 

why there is no indent since 20px is assigned? I always thought that 20px + block100% + 20px = scroll

  • make the answer - I removed 100% and margin = 20px from all sides - user33274

1 answer 1

Probably because of the width: 100%. The width of your div is set to the width of the parent element.

  • but actually make 20px + div 100% div + 20px really do ?? exactly 100% - user33274
  • If you do not set the width of the block element, it already occupies the entire width of the parent. Those. specifically do nothing. - Vladimir Gamalyan
  • one
    If it is absolutely important, then something like this: width: calc (100% - 40px) - Vladimir Gamalyan
  • and here two times you can choose the best answer ??? - user33274