fune/layout/docs/css-grid-3/examples/align-tracks-example-2.html
Mats Palmgren 30b76b523c Bug 1665152 - Initial CSS Masonry draft spec. r=dholbert
NPOTB DONTBUILD

The Overview.html file was generated by this command:
curl https://api.csswg.org/bikeshed/ -F file=@layout/docs/css-grid-3/Overview.bs -F force=1 > layout/docs/css-grid-3/Overview.html

Differential Revision: https://phabricator.services.mozilla.com/D90302
2020-09-23 15:56:38 +00:00

59 lines
1.4 KiB
HTML

<!DOCTYPE HTML>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<style>
.grid {
display: inline-grid;
grid: masonry / 150px 100px 50px;
gap: 3px;
padding: 10px;
border: 3px solid;
background: lightgrey content-box;
align-tracks: stretch;
height: 150px;
transition: height 6s linear;
}
item {
display: list-item;
list-style-type: decimal;
list-style-position: inside;
background: grey;
height: 20px;
position: relative;
}
item:nth-child(2n) { background:purple; height:auto; }
item:nth-child(1) { border:10px solid; margin: 10px 0 5px 3px; }
z { display: block; background: yellow; height: 20%; width:80%; }
a {
position: absolute;
inset: 0;
top: auto;
border: 2px solid lime;
}
</style>
<body onload="[...document.querySelectorAll('.grid')].forEach(e=>e.style.height='500px')">
<div class="grid">
<item></item>
<item></item>
<item></item>
<item style="max-height:40px; margin-top: 10px">40px</item>
<item></item>
<item><a></a></item>
<item></item>
<item style="writing-mode:vertical-lr">vertical</item>
<item><a></a></item>
<item>A<br>B</item>
<item></item>
<item><z></z></item>
<item></item>
<item><z></z><a></a></item>
<item></item>
<item style="align-self:end"></item>
<item></item>
<item style="margin:auto 0; align-self:start"></item>
<item></item>
<item style="margin-top: auto"></item>
</div><td>