flexbox-flex-basis-content-002b.html (2463B)
1 <!DOCTYPE html> 2 <!-- 3 Any copyright is dedicated to the Public Domain. 4 http://creativecommons.org/publicdomain/zero/1.0/ 5 --> 6 <html> 7 <head> 8 <title> 9 CSS Test: Testing "flex-basis: content" (set via the "flex" shorthand) 10 in a column-oriented flex container. 11 </title> 12 <meta charset="utf-8"> 13 <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"> 14 <link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#propdef-flex-basis"> 15 <link rel="match" href="flexbox-flex-basis-content-002-ref.html"> 16 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> 17 <style> 18 .container { 19 display: flex; 20 flex-direction: column; 21 justify-content: space-between; 22 border: 2px solid purple; 23 padding: 2px; 24 margin-right: 2em; 25 width: 50px; 26 height: 200px; 27 float: left; 28 } 29 30 .container > * { 31 /* All flex items have "flex-basis: content" (and zero flex-shrink and 32 min-main-size, to avoid any influence from those). */ 33 flex: 0 0 content; 34 min-height: 0; 35 border: 2px solid teal; 36 } 37 38 .smallText { font: 10px Ahem; } 39 .bigText { font: 20px Ahem; } 40 .spacerChild::before { 41 content: ''; 42 display: block; 43 background: brown; 44 height: 10px; 45 width: 10px; 46 } 47 .justPadding { 48 /* Empty div with 5px padding on each side */ 49 padding: 5px; 50 background: cyan; 51 } 52 canvas { background: fuchsia } 53 </style> 54 </head> 55 <body> 56 <!-- Flex items have unspecified size properties: --> 57 <div class="container"> 58 <div class="smallText">a b</div> 59 <div class="bigText">c</div> 60 <div class="spacerChild"></div> 61 <div class="justPadding"></div> 62 <canvas height="20"></canvas> 63 </div> 64 65 <!-- Various specified main-size values (should be ignored): --> 66 <div class="container"> 67 <div class="smallText" style="height: 0px">a b</div> 68 <div class="bigText" style="height: 40px">c</div> 69 <div class="spacerChild" style="height: 20px"></div> 70 <div class="justPadding" style="height: 10px"></div> 71 <canvas height="20" style="height: 8px"></canvas> 72 </div> 73 74 <!-- Various specified cross-size values (should be honored): --> 75 <div class="container"> 76 <div class="smallText" style="width: 0px">a b</div> 77 <div class="bigText" style="width: 40px">c</div> 78 <div class="spacerChild" style="width: 20px"></div> 79 <div class="justPadding" style="width: 10px"></div> 80 <canvas height="20" style="width: 8px"></canvas> 81 </div> 82 83 </body> 84 </html>