flexbox-single-row-2.html (3229B)
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: Fragmentation of fixed block-size single-line row flex container with fixed block-size flex items</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 <link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#pagination"> 10 <link rel="match" href="flexbox-single-row-2-ref.html"> 11 <meta name="assert" content="This test verifies fragmentation of fixed block-size flex items in a block-size:auto single-line row flex container, with various combinations of margin/border/padding, alignments, and column-gap. The block-size of the flex container is made shorter than <header>."> 12 13 <style> 14 .multicol { 15 block-size: 50px; 16 inline-size: 320px; 17 column-count: 3; 18 column-fill: auto; 19 column-gap: 10px; 20 border: 5px solid orange; 21 margin-block-end: 5px; /* Just to separate each sub-testcase visually. */ 22 } 23 .flexContainer { 24 display: flex; 25 flex-wrap: nowrap; 26 flex-direction: row; 27 background: gray; 28 /* border-width is 0 by default; some sub-testcases will increase it. */ 29 border: 0 solid lightgray; 30 /* Block-size is deliberately made shorter than <header>. */ 31 block-size: 80px; 32 } 33 .border-padding { 34 border-block-width: 10px; 35 padding-block: 5px; 36 } 37 38 /* Note: flex items are in visual order as "CMYK": cyan, magenta, yellow, black. */ 39 header, nav, article, footer { 40 flex-grow: 1; 41 } 42 header { 43 background: cyan; 44 block-size: 100px; 45 } 46 nav { 47 background: magenta; 48 block-size: 25px; 49 align-self: flex-start; 50 } 51 article { 52 background: yellow; 53 block-size: 50px; 54 align-self: center; 55 } 56 footer { 57 background: black; 58 block-size: 75px; 59 align-self: flex-end; 60 } 61 </style> 62 63 <body> 64 <!-- Basic one without any margin/border/padding. --> 65 <div class="multicol"> 66 <div class="flexContainer"> 67 <header></header><nav></nav><article></article><footer></footer> 68 </div> 69 </div> 70 71 <!-- Test a container with margin-block-start. --> 72 <div class="multicol"> 73 <div class="flexContainer" style="margin-block-start: 25px"> 74 <header></header><nav></nav><article></article><footer></footer> 75 </div> 76 </div> 77 78 <!-- Test a container not at the top of the column/page. --> 79 <div class="multicol"> 80 <div style="block-size: 25px"></div> 81 <div class="flexContainer"> 82 <header></header><nav></nav><article></article><footer></footer> 83 </div> 84 </div> 85 86 <!-- Test a container with border and padding. --> 87 <div class="multicol"> 88 <div class="flexContainer border-padding"> 89 <header></header><nav></nav><article></article><footer></footer> 90 </div> 91 </div> 92 93 <!-- Test a container with border, padding, and column-gap. --> 94 <div class="multicol"> 95 <div class="flexContainer border-padding" style="column-gap: 4px"> 96 <header></header><nav></nav><article></article><footer></footer> 97 </div> 98 </div> 99 </body> 100 </html>