summaryrefslogtreecommitdiffstats
path: root/layout/reftests/css-grid/grid-container-baselines-001.html
blob: 529632ae619562062809106a37449cdc63caabbe (plain)
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
87
88
89
90
91
92
<!DOCTYPE HTML>
<!--
     Any copyright is dedicated to the Public Domain.
     http://creativecommons.org/publicdomain/zero/1.0/
-->
<html><head>
  <meta charset="utf-8">
  <title>CSS Grid Test: Grid container baselines</title>
  <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1151204">
  <link rel="help" href="https://drafts.csswg.org/css-grid/#grid-baselines">
  <link rel="match" href="grid-container-baselines-001-ref.html">
  <link rel="stylesheet" type="text/css" href="support/ahem.css">
  <style type="text/css">
html,body {
    color:black; background-color:white; font:16px/1 Ahem; padding:0; margin:0;
}

.grid {
  display: inline-grid;
  grid: 120px / repeat(4, min-content);
  align-items: start;
  justify-items: start;
  border: 2px solid;
  margin: 1px;
}
.r2 { grid-template-rows: 0 120px; }
.r3 { grid-template-rows: 50px 70px; }
.r4 { grid-template-rows: 120px 0; }
.grid .grid {
  border: 0;
  margin: 0;
}
.vgrid { grid: repeat(4, min-content) / 120px;}

span { 
  background: lime;
  display: inline-block;
  border: 1px solid black;
}
span:nth-child(1) {font-size:32px; }
span:nth-child(2) {font-size:12px; padding-block-end:20px;}

.sfb { align-self:baseline; }
.slb { align-self:last baseline; }
.cfb { align-content:baseline; align-self:start; }
.clb { align-content:last baseline; align-self:end; }
.s { align-self:stretch; }

.jfb { justify-self:baseline; }
.jlb { justify-self:last baseline; }

.hl { writing-mode: horizontal-tb; direction:ltr; }
.hr { writing-mode: horizontal-tb; direction:rtl; }
.vl { writing-mode: vertical-lr; }
.vr { writing-mode: vertical-rl; }
.vlr { writing-mode: vertical-lr; direction:rtl; }
.vrl { writing-mode: vertical-rl; direction:ltr; }

</style>
</head>
<body>

A<div class="grid"><span>B<br>B</span><span>C<br>C</span></div>
<div class="grid"><span>B<br>B</span><span class="sfb">C<br>C</span></div>
<div class="grid"><span>B<br>B</span><span class="slb">C<br>C</span></div>

<!-- <div class="grid"><span>B<br>B</span><span class="sfb">C<br>C</span><span class="sfb">C<br>C</span></div> -->
<!-- <div class="grid"><span>B<br>B</span><span class="sfb">C<br>C</span><span class="sfb vl" style="padding:20px 0">D<br>D</span></div> -->

<div class="grid"><span class="slb">B<br>B</span><span class="slb">C<br>C</span></div>
<div class="grid"><span style="order:1">B<br>B</span><span>C<br>C</span></div>
<div class="grid"><span style="order:1">B<br>B</span><span class="sfb">C<br>C</span></div>

<!--
<div class="grid r2"><span style="grid-row:2">B<br>B</span><span style="grid-row:2">C<br>C</span></div>
<div class="grid r2"><span style="grid-row:2; order:1">B<br>B</span><span style="grid-row:2">C<br>C</span></div>
-->

<div class="grid r2"><span style="grid-row:span 2">B<br>B</span><span style="grid-row:span 2">C<br>C</span></div>
<div class="grid r2"><span style="grid-row:span 2; order:1">B<br>B</span><span style="grid-row:span 2">C<br>C</span></div>
<div class="grid r3"><span style="grid-row:span 2">B<br>B</span><span style="grid-row:span 2">C<br>C</span></div>
<div class="grid r3"><span style="grid-row:span 2; order:1">B<br>B</span><span style="grid-row:span 2">C<br>C</span></div>

<br>
A<!--<div class="grid r4"><span>B<br>B</span><span>C<br>C</span></div>
<div class="grid r4"><span style="order:1">B<br>B</span><span>C<br>C</span></div>
<div class="grid"><div class="grid"><span>B<br>B</span><span>C<br>C</span></div></div>
<div class="grid"><div class="grid"><div class="grid"><span>B<br>B</span><span>C<br>C</span></div></div></div>
--><div class="grid"><div class="grid r3"><span style="grid-row:2">B<br>B</span><span style="grid-row:2">C<br>C</span></div></div>

</body>
</html>