flexbox-single-row-1-ref.html (3401B)
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 single-line row 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: 320px; 14 column-count: 3; 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: 100px; 25 position: relative; 26 } 27 .border-padding { 28 border-block-width: 10px; 29 padding-block: 5px; 30 } 31 .gap { 32 inline-size: 4px; 33 block-size: 100%; 34 } 35 36 /* Note: flex items are in visual order as "CMYK": cyan, magenta, yellow, black. */ 37 header, nav, article, footer { 38 inline-size: 25px; 39 } 40 header { 41 background: cyan; 42 block-size: 100px; 43 position: absolute; 44 inset-block-start: 0px; 45 } 46 nav { 47 background: magenta; 48 block-size: 25px; 49 position: absolute; 50 inset-block-start: 0px; 51 inset-inline-start: 25px; 52 } 53 article { 54 background: yellow; 55 block-size: 50px; 56 position: absolute; 57 inset-block-start: 25px; 58 inset-inline-start: 50px; 59 } 60 footer { 61 background: black; 62 block-size: 75px; 63 position: absolute; 64 inset-block-start: 25px; 65 inset-inline-start: 75px; 66 } 67 </style> 68 69 <body> 70 <!-- Basic one without any margin/border/padding. --> 71 <div class="multicol"> 72 <div class="flexContainer"> 73 <header></header><nav></nav><article></article><footer></footer> 74 </div> 75 </div> 76 77 <!-- Test a container with margin-block-start. --> 78 <div class="multicol"> 79 <div class="flexContainer" style="margin-block-start: 25px"> 80 <header></header><nav></nav><article></article><footer></footer> 81 </div> 82 </div> 83 84 <!-- Test a container not at the top of the column/page. --> 85 <div class="multicol"> 86 <div style="block-size: 25px"></div> 87 <div class="flexContainer"> 88 <header></header><nav></nav><article></article><footer></footer> 89 </div> 90 </div> 91 92 <!-- Test a container with border and padding. --> 93 <div class="multicol"> 94 <div class="flexContainer border-padding"> 95 <!-- Adjust top to simulate padding. --> 96 <header style="inset-block-start: 5px"></header><nav style="inset-block-start: 5px"></nav> 97 <article style="inset-block-start: 30px"></article><footer style="inset-block-start: 30px"></footer> 98 </div> 99 </div> 100 101 <!-- Test a container with border, padding, and column-gap. --> 102 <div class="multicol"> 103 <div class="flexContainer border-padding"> 104 <header style="inline-size: 22px; inset-block-start: 5px"></header> 105 <nav style="inline-size: 22px; inset-block-start: 5px; inset-inline-start: 26px"></nav> 106 <article style="inline-size: 22px; inset-block-start: 30px; inset-inline-start: 52px;"></article> 107 <footer style="inline-size: 22px; inset-block-start: 30px; inset-inline-start: 78px;"></footer> 108 </div> 109 </div> 110 </body> 111 </html>