flexbox-multi-column-2-ref.html (3108B)
1 <!DOCTYPE html> 2 <!-- Any copyright is dedicated to the Public Domain. 3 http://creativecommons.org/publicdomain/zero/1.0/ --> 4 <html> 5 <meta charset="utf-8"> 6 <title>CSS Flexbox Test Reference: Fragmentation of multi-line column flex container</title> 7 <link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com"> 8 <link rel="author" title="Mozilla" href="http://www.mozilla.org/"> 9 10 <style> 11 .multicol { 12 block-size: 50px; 13 inline-size: 190px; 14 column-width: 90px; 15 column-fill: auto; 16 column-gap: 10px; 17 border: 5px solid orange; 18 margin-block-end: 5px; /* Just to separate each sub-testcase visually. */ 19 } 20 .flexContainer { 21 background: gray; 22 /* border-width is 0 by default; some sub-testcases will increase it. */ 23 border: 0 solid lightgray; 24 block-size: 60px; 25 position: relative; 26 } 27 .border-padding { 28 border-block-width: 10px; 29 padding-block: 5px; 30 } 31 32 /* Note: flex items are in visual order as "CMYK": cyan, magenta, yellow, black. */ 33 header, nav, article, footer { 34 inline-size: 20px; 35 } 36 header { 37 background: cyan; 38 block-size: 50px; 39 position: absolute; 40 inset-block-start: 0; 41 inset-inline-start: 0; 42 } 43 nav { 44 background: magenta; 45 block-size: 25px; 46 position: absolute; 47 inset-block-start: 0; 48 inset-inline-start: 30px; 49 } 50 article { 51 background: yellow; 52 block-size: 25px; 53 position: absolute; 54 inset-block-start: 25px; 55 inset-inline-start: 35px; 56 } 57 footer { 58 background: black; 59 block-size: 50px; 60 position: absolute; 61 inset-block-start: 0; 62 inset-inline-start: 70px; 63 } 64 .border-padding > header, .border-padding > nav, .border-padding > footer { 65 inset-block-start: 5px; 66 } 67 .border-padding > article { 68 inset-block-start: 30px; 69 } 70 </style> 71 72 <body> 73 <!-- Basic one without any margin/border/padding. --> 74 <div class="multicol"> 75 <div class="flexContainer"> 76 <header></header><nav></nav><article></article><footer></footer> 77 </div> 78 </div> 79 80 <!-- Test a container with margin-block-start. --> 81 <div class="multicol"> 82 <div class="flexContainer" style="margin-block-start: 25px"> 83 <header></header><nav></nav><article></article><footer></footer> 84 </div> 85 </div> 86 87 <!-- Test a container not at the top of the column/page. --> 88 <div class="multicol"> 89 <div style="block-size: 25px"></div> 90 <div class="flexContainer"> 91 <header></header><nav></nav><article></article><footer></footer> 92 </div> 93 </div> 94 95 <!-- Test a container with border and padding. --> 96 <div class="multicol"> 97 <div class="flexContainer border-padding"> 98 <header></header><nav></nav><article style="inset-block-start: 30px"></article><footer></footer> 99 </div> 100 </div> 101 102 <!-- Test a container with border, padding, and row-gap. --> 103 <div class="multicol"> 104 <div class="flexContainer border-padding"> 105 <header></header><nav></nav><article style="inset-block-start: 35px"></article><footer></footer> 106 </div> 107 </div> 108 </body> 109 </html>