tor-browser

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

grid-lanes-subgrid-002b-ref.html (1750B)


      1 <!DOCTYPE HTML>
      2 <!--
      3     Any copyright is dedicated to the Public Domain.
      4     http://creativecommons.org/publicdomain/zero/1.0/
      5 -->
      6 <html><head>
      7  <meta charset="utf-8">
      8  <title>Reference: Grid Lanes layout with a subgrid (grid-lanes-subgrid-002b)</title>
      9  <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com">
     10 <style>
     11 html,body {
     12  color:black; background-color:white; font:10px/1 monospace; padding:0; margin:0;
     13 }
     14 
     15 grid {
     16  display: inline-grid;
     17  grid-template-rows: 40px 30px 20px;
     18  grid-template-columns: grid-lanes;
     19  gap: 4px 2px;
     20  padding: 1px 3px 5px 7px;
     21  border: solid;
     22  border-width: 3px 5px 1px 1px;
     23  background: lightgrey content-box;
     24  grid-auto-flow: column;
     25 }
     26 .rows {
     27  grid-template-columns: 40px 30px 20px;
     28  grid-template-rows: grid-lanes;
     29  grid-auto-flow: row;
     30 }
     31 item {
     32  background: grey;
     33  width: 3ch;
     34  position: relative;
     35 }
     36 item:nth-child(2n) { background:purple; width:auto; }
     37 item:nth-child(1) {
     38  border: solid;
     39  border-width: 3px 5px 1px 1px;
     40  margin: 7px 1px 5px 3px;
     41 }
     42 subgrid {
     43  display: grid;
     44  grid-row: auto/span 2;
     45  grid-column: auto/span 2;
     46  grid: subgrid / subgrid;
     47  grid-gap: 6px 8px;
     48  background: yellow;
     49 }
     50 subgrid.definite {
     51  grid-row-start:2;
     52 }
     53 subgrid.extent {
     54  grid-row: 1/span 3;
     55 }
     56 .rows > subgrid.definite {
     57  grid-column-start:2;
     58  grid-row-start:auto;
     59 }
     60 .rows > subgrid.extent {
     61  grid-row: auto/span 2;
     62  grid-column: 1/span 3;
     63 }
     64 </style>
     65 </head>
     66 <body>
     67 
     68 <!-- auto-placed subgrid inhibits subgridding when parent is doing grid-lanes layout ... -->
     69 
     70 <grid class="rows">
     71  <item>1</item>
     72  <subgrid class="definite">
     73    <item>4a</item>
     74    <item>4b</item>
     75    <item>4c</item>
     76  </subgrid>
     77  <item>2</item>
     78  <item>3</item>
     79  <item>5</item>
     80 </grid>
     81 
     82 </body></html>