multicol-span-all-dynamic-add-004.html (1555B)
1 <!DOCTYPE html> 2 <html class="reftest-wait"> 3 <meta charset="utf-8"> 4 <title>CSS Multi-column Layout Test: Add the spanner to the inner column</title> 5 <link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com"> 6 <link rel="author" title="Mozilla" href="http://www.mozilla.org/"> 7 <link rel="help" href="https://drafts.csswg.org/css-multicol-1/#column-span"> 8 <link rel="match" href="multicol-span-all-dynamic-add-004-ref.html"> 9 <meta name="assert" content="This test checks a dynamically added 'column-span' element should be rendered correctly."> 10 11 <script> 12 function runTest() { 13 document.body.offsetHeight; 14 15 /* Add the spanner to the inner column. */ 16 var spanner = document.createElement("h3"); 17 var text = document.createTextNode("spanner"); 18 spanner.appendChild(text); 19 20 var innerColumn = document.getElementById("inner-column"); 21 innerColumn.insertBefore(spanner, innerColumn.children[1]); 22 23 document.documentElement.removeAttribute("class"); 24 } 25 </script> 26 27 <style> 28 body { 29 width: 400px; 30 } 31 article { 32 column-count: 2; 33 column-rule: 6px solid; 34 outline: 1px solid black; 35 } 36 h3 { 37 column-span: all; 38 outline: 1px solid blue; 39 } 40 </style> 41 42 <body onload="runTest();"> 43 <article id="column"> 44 <article id="inner-column"> 45 <div>inner block1</div> 46 <div>inner block2</div> 47 </article> 48 <article> 49 <div>inner block3</div> 50 <h3>static spanner</h3> 51 <div>inner block4</div> 52 </article> 53 </article> 54 </body> 55 </html>