display-contents-block-002.html (654B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Display: margin collapsing through display:contents</title> 4 <link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-display-3/#valdef-display-contents"> 6 <link rel="match" href="display-contents-block-002-ref.html"> 7 <style> 8 #outer { margin-top: 100px } 9 #inner { margin-top: 300px } 10 #contents { 11 display: contents; 12 margin-top: 2000px 13 } 14 </style> 15 <p>You should see the word PASS with a 300px top margin below.</p> 16 <div id="outer"> 17 <div id="contents"> 18 <div id="inner">PASS</div> 19 </div> 20 </div>