File: masonry-justify-tracks-stretch-001-ref.html

package info (click to toggle)
thunderbird 1%3A78.8.0-1~deb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,910,720 kB
  • sloc: cpp: 5,890,568; javascript: 4,416,354; ansic: 3,051,657; python: 917,001; asm: 304,197; xml: 206,624; sh: 109,232; java: 108,679; makefile: 22,984; perl: 15,867; yacc: 4,565; objc: 3,026; pascal: 1,787; lex: 1,720; ada: 1,681; cs: 879; exp: 505; awk: 485; sql: 452; php: 436; lisp: 432; ruby: 99; sed: 69; csh: 45
file content (86 lines) | stat: -rw-r--r-- 2,374 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE HTML>
<!--
     Any copyright is dedicated to the Public Domain.
     http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
  <meta charset="utf-8">
  <title>Reference: Masonry layout with `justify-tracks:stretch`</title>
  <link rel="author" title="Mats Palmgren" href="mailto:mats@mozilla.com">
  <link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
html,body {
  color:black; background-color:white; font:16px/1 Ahem; padding:0; margin:0;
}
grid {
  display: inline-grid;
  grid-template-rows: 150px 100px 50px;
  grid-template-columns: 500px;
  gap: 5px 3px;
  padding: 10px;
  border: 3px solid;
  background: lightgrey content-box;
  width: 500px;
}
masonry-track {
  display: grid;
  gap: 5px 3px;
  width: 500px;
}
masonry-track:nth-child(1) {
  grid-template-rows: 150px;
  grid-template-columns: max-content auto auto min-content min-content auto;
}
masonry-track:nth-child(2) {
  grid-template-rows: 100px;
  grid-template-columns: auto 50px 3ch 3ch 3ch  min-content min-content;
}
masonry-track:nth-child(3) {
  grid-template-rows: 50px;
  grid-template-columns: 3ch auto 3ch 3ch auto 3ch auto;
}
item {
  background: grey;
  width: 3ch;
  position: relative;
}
.purple { background:purple; width:auto; }
z { display: block; background: yellow; width: 20%; height:10%; }
a {
 position: absolute;
 inset: 0;
 left: auto;
 border: 2px solid lime;
}
</style>
</head>
<body>
<grid>
 <masonry-track>
  <item style="border:10px solid; margin:10px 0 5px 3px;">1</item>
  <item style="writing-mode:vertical-lr" class="purple">8<br>vertical</item>
  <item class="purple">10</item>
  <item class="purple" style="width:86px; border:solid; border-width:0 2px; margin-right:1px">12<z></z></item>
  <item>15</item>
  <item style="margin:0 auto" class="purple">18</item>
 </masonry-track>
 <masonry-track>
  <item class="purple">2</item>
  <item style="width:40px; margin-right:10px" class="purple">4</item>
  <item>5</item>
  <item>9<a></a></item>
  <item>13</item>
  <item style="justify-self:start" class="purple">16</item>
  <item>19</item>
 </masonry-track>
 <masonry-track>
  <item>3</item>
  <item class="purple">6<a></a></item>
  <item>7</item>
  <item>11</item>
  <item class="purple">14<z></z><a></a></item>
  <item>17</item>
  <item style="margin-left: auto" class="purple">20</item>
 </masonry-track>
</grid>
</body></html>