-
Notifications
You must be signed in to change notification settings - Fork 14
/
aspect-ratio.html
executable file
·52 lines (47 loc) · 1.49 KB
/
aspect-ratio.html
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<html>
<head>
<title>A gallery with and without aspect ratios defined</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="c/base.css">
<style type="text/css">
body {width: 45em; padding-right: 1em;}
.arena, section {display: flex; justify-content: start; align-items: start; gap: 3em;}
.arena div {width: auto; border: 1px solid; padding: 0.5em; background: linear-gradient(147deg,#0001,#0005); box-shadow: 0.125em 0.125em 0.25em #0003;}
figcaption {text-align: center; font: 1em Consolas, monospace; padding-bottom: 0.5em;}
section {display: flex; gap: 0.25em;}
figure {margin: 0;}
.gallery div {aspect-ratio: 1/1;}
.gallery div:nth-child(1) {height: 4em;}
.gallery div:nth-child(2) {height: 4.2em;}
.gallery div:nth-child(3) {height: 3.5em;}
.gallery div:nth-child(4) {height: 5em;}
.gallery div:nth-child(5) {height: 2.5em;}
</style>
</head>
<body>
<main class="arena">
<figure class="gallery">
<figcaption>aspect-ratio: 1/1</figcaption>
<section>
<div>This is the first item</div>
<div>2 Fast 2 Item</div>
<div>Item III</div>
<div>This item goes forth</div>
<div>Item #5</div>
</section>
</figure>
<figure>
<figcaption>aspect-ratio: auto</figcaption>
<section>
<div>This is the first item</div>
<div>2 Fast 2 Item</div>
<div>Item III</div>
<div>This item goes forth</div>
<div>Item #5</div>
</section>
</figure>
</main>
</body>
</html>