Unable to understand negative margin

Take a look at the following html ...

.wrapper {
  position: relative;
}

.mydiv1 {
  margin-left: -10px;
  margin-top: -10px;
}
<div class="wrapper">
  <div class="mydiv1">div1</div>
</div>
Run code

.mydiv1was pulled to the left as 10pxwell as through its parental left border. But nothing really happens. Why does it work differently?

+4
source share

Source: https://habr.com/ru/post/1677636/


All Articles