CSS positive padding with negative margin

gznwow

New Member
I saw the following css in the Sonata project.HTML:\[code\]<div class="content"> <div class="header"></div></div>\[/code\]CSS:\[code\].content { padding: 20px; margin: 0 -20px; /* negative indent the amount of the padding to maintain the grid system */}.header { padding: 20px 20px 10px; margin: -20px -20px 20px;}\[/code\]My question is, what is the purpose/advantage of having positive paddings and then negate them with negative margins? The code does have a comment on negative margin but I don't really get it. Why not just set both margin and padding to 0?Thanks!
 
Top