0
votes

I am fairly versed with CSS box model however I always get confused with margins. For example, if a child div has a margin (say margin:10px;) and parent div has a padding(padding: 10px) then does the browser calculate the child margin space with respect to inner edge of parent div's padding or outer edge of parent div's padding.

In this CSS Margin calculation the answerer states: Margin - that's the space from the parent, it stacks with the parent's padding however he does not specify whether, it's stacks with inner or outer edge of padding if specified on parent.

Thanks dkjain

1
Inner edge of the parent element - Mr. Alien

1 Answers

0
votes

The margin of child div is stacked with the inner edge of the parent div's padding.