tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

flexbox-flex-basis-content-002a.html (2449B)


      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" in a column-oriented flex container
     10  </title>
     11  <meta charset="utf-8">
     12  <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
     13  <link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#propdef-flex-basis">
     14  <link rel="match" href="flexbox-flex-basis-content-002-ref.html">
     15  <link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
     16  <style>
     17  .container {
     18    display: flex;
     19    flex-direction: column;
     20    justify-content: space-between;
     21    border: 2px solid purple;
     22    padding: 2px;
     23    margin-right: 2em;
     24    width: 50px;
     25    height: 200px;
     26    float: left;
     27  }
     28 
     29  .container > * {
     30    /* All flex items have "flex-basis: content" (and zero flex-shrink and
     31       min-main-size, to avoid any influence from those). */
     32    flex-basis: content;
     33    flex-shrink: 0;
     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>