-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Expand file tree
/
Copy pathalign-items-static-position-ref.html
More file actions
73 lines (66 loc) · 1.44 KB
/
align-items-static-position-ref.html
File metadata and controls
73 lines (66 loc) · 1.44 KB
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
<!DOCTYPE html>
<link rel="author" title="David Shin" href="mailto:dshin@mozilla.com">
<link rel="help" href="https://drafts.csswg.org/css-align-3/#valdef-align-self-auto">
<link rel="help" href="https://drafts.csswg.org/css-align-3/#valdef-justify-self-auto">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1930561">
<style>
.flex {
display: flex;
align-items: center;
width: 100%;
height: 100%;
}
.grid {
display: grid;
justify-items: center;
align-items: center;
width: 100%;
height: 100%;
}
.container {
border: 1px solid;
position: relative;
width: 100px;
height: 100px;
display: inline-block;
margin-right: 5px;
}
.abs {
width: 50px;
height: 50px;
position: absolute;
background: purple;
}
.center-inline {
left: 25px;
}
.left {
left: 0;
}
.top {
top: 0;
}
.center-block {
top: 25px;
}
</style>
<div class="container"><div class="flex">
<div class="abs left center-block"></div>
</div></div>
<div class="container"><div class="flex">
<div class="abs left top"></div>
</div></div>
<br>
<div class="container"><div class="grid">
<div class="abs center-inline center-block"></div>
</div></div>
<div class="container"><div class="grid">
<div class="abs center-inline top"></div>
</div></div>
<div class="container"><div class="grid">
<div class="abs left center-block"></div>
</div></div>
<div class="container"><div class="grid">
<div class="abs left top"></div>
</div></div>
<br>