CSS margin description

Hello! Can someone clarify what the sentence means:
“If one margin is negative, its value will be subtracted from the total.”
Total from what?

Hi @martinteam and welcome to the community :wave:

Sorry for the long delay.

This should read “If one margin is negative, its value will be subtracted from the positive margin”. So when one margin is 50px and the other one is -40px they’ll collapse to an 10px margin.

At the bottom of the article is a box where you can report this issue if you like.

Have a nice day,
Michael

Hi martin,
you can test it quite simply in the given example at https://mdn.github.io/css-examples/learn/box-model/margin-collapse.html when you set first to 50px (for CSS selector .one), the second for .two to -50px: it sums up to zero, like one stepforward, one step back :slight_smile:

1 Like