tor-browser

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

flexbox-flex-basis-content-001a.html (2425B)


      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 row-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-001-ref.html">
     15  <link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
     16  <style>
     17  .container {
     18    display: flex;
     19    flex-direction: row;
     20    justify-content: space-between;
     21    border: 2px solid purple;
     22    padding: 2px;
     23    margin-bottom: 2em;
     24    height: 50px;
     25    width: 200px;
     26  }
     27 
     28  .container > * {
     29    /* All flex items have "flex-basis: content" (and zero flex-shrink and
     30       min-main-size, to avoid any influence from those). */
     31    flex-basis: content;
     32    flex-shrink: 0;
     33    min-width: 0;
     34    border: 2px solid teal;
     35  }
     36 
     37  .smallText { font: 10px Ahem; }
     38  .bigText   { font: 20px Ahem; }
     39  .spacerChild::before {
     40    content: '';
     41    display: block;
     42    background: brown;
     43    height: 10px;
     44    width: 10px;
     45  }
     46  .justPadding {
     47    /* Empty div with 5px padding on each side */
     48    padding: 5px;
     49    background: cyan;
     50  }
     51  canvas { background: fuchsia }
     52  </style>
     53 </head>
     54 <body>
     55 <!-- Flex items have unspecified size properties: -->
     56 <div class="container">
     57  <div class="smallText">a b</div>
     58  <div class="bigText">c</div>
     59  <div class="spacerChild"></div>
     60  <div class="justPadding"></div>
     61  <canvas width="20"></canvas>
     62 </div>
     63 
     64 <!-- Various specified main-size values (should be ignored): -->
     65 <div class="container">
     66  <div class="smallText"    style="width: 0px">a b</div>
     67  <div class="bigText"      style="width: 40px">c</div>
     68  <div class="spacerChild"  style="width: 20px"></div>
     69  <div class="justPadding"  style="width: 10px"></div>
     70  <canvas width="20"        style="width: 8px"></canvas>
     71 </div>
     72 
     73 <!-- Various specified cross-size values (should be honored): -->
     74 <div class="container">
     75  <div class="smallText"    style="height: 0px">a b</div>
     76  <div class="bigText"      style="height: 40px">c</div>
     77  <div class="spacerChild"  style="height: 20px"></div>
     78  <div class="justPadding"  style="height: 10px"></div>
     79  <canvas width="20"        style="height: 8px"></canvas>
     80 </div>
     81 
     82 </body>
     83 </html>