multicol-span-all-dynamic-add-002.html (1355B)
1 <!DOCTYPE html> 2 <html class="reftest-wait"> 3 <meta charset="utf-8"> 4 <title>CSS Multi-column Layout Test: Add the spanner as the second child of the columns</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-002-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 as the second child of the columns. */ 16 var spanner = document.createElement("h3"); 17 var text = document.createTextNode("spanner"); 18 spanner.appendChild(text); 19 20 var column = document.getElementById("column"); 21 column.insertBefore(spanner, column.children[1]); 22 23 document.documentElement.removeAttribute("class"); 24 } 25 </script> 26 27 <style> 28 #column { 29 column-count: 3; 30 column-rule: 6px solid; 31 width: 400px; 32 outline: 1px solid black; 33 } 34 h3 { 35 column-span: all; 36 outline: 1px solid blue; 37 } 38 </style> 39 40 <body onload="runTest();"> 41 <article id="column"> 42 <div>block1</div> 43 <div>block2</div> 44 </article> 45 </body> 46 </html>