-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathself-alignment.html
99 lines (89 loc) · 2.61 KB
/
self-alignment.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
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
93
94
95
96
97
98
99
<!DOCTYPE html>
<html>
<head>
<link href="css/grid.css" rel="stylesheet">
<style>
.grid {
grid-template-columns: 100px 100px;
-ms-grid-columns: 100px 100px;
grid-template-rows: 200px 200px;
-ms-grid-rows: 200px 200px;
width: -webkit-fit-content;
}
.item {
width: 30px;
height: 60px;
}
.content {
width: 10px;
height: 20px;
background: black;
}
.alignItemsStart {
align-items: start;
}
.alignItemsEnd {
align-items: end;
}
.justifyItemsStart {
justify-items: start;
}
.justifyItemsEnd {
justify-items: end;
}
.alignSelfSelfStart {
align-self: self-start;
}
.alignSelfSelfEnd {
align-self: self-end;
}
.justifySelfSelfStart {
justify-self: self-start;
}
.justifySelfSelfEnd {
justify-self: self-end;
}
.verticalRL {
-webkit-writing-mode: vertical-rl;
}
.verticalLR {
-webkit-writing-mode: vertical-lr;
}
.directionRTL {
direction: rtl;
}
</style>
</head>
<body>
<p>Item at 1:1 has a different block-axis direction. The 'self-start' value aligns the alignment subject to be flush with the edge of the alignment container corresponding to the alignment subject's start side.</p>
<div class="grid verticalRL alignItemsStart justifyItemsStart">
<div class="item row1-column1 verticalLR alignSelfSelfStart">
<div class="content"></div>
</div>
<div class="item row1-column2">
<div class="content"></div>
</div>
<div class="item row2-column1">
<div class="content"></div>
</div>
<div class="item row2-column2">
<div class="content"></div>
</div>
</div>
<p>Item at 1:1 has a different inline-axis direction. The 'self-end' value aligns the alignment subject to be flush with the edge of the alignment container corresponding to the alignment subject's end side.</p>
<div class="grid alignItemsEnd justifyItemsEnd">
<div class="item row1-column1 directionRTL justifySelfSelfEnd">
<div class="content"></div>
</div>
<div class="item row1-column2">
<div class="content"></div>
</div>
<div class="item row2-column1">
<div class="content"></div>
</div>
<div class="item row2-column2">
<div class="content"></div>
</div>
</div>
</body>
</html>