CodePen

HTML

            
              <h2>Collapsing Margins</h2>
<div><p>Example text.</p></div>
            
          
!
via HTML Inspector

CSS

            
              h2 {
    margin: 0 0 20px 0;
}

div {
    margin-top: 40px;  
}

p {
    margin-top: 30px;
}
            
          
!
? ?
? ?
Must be a valid URL.
+ add another resource
via CSS Lint

JS

            
              
            
          
!
Must be a valid URL.
+ add another resource
via JS Hint
Loading ..................