-
Notifications
You must be signed in to change notification settings - Fork 0
/
006-flex.html
202 lines (182 loc) · 8.95 KB
/
006-flex.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>tailwindcss</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<!-- https://tailwindcss.com/docs/flex -->
<!-- https://tailwindcss.com/docs/width -->
<!-- https://tailwindcss.com/docs/gap -->
<div class="flex border-4 border-red-300 m-3">
<div class="p-2 border-4 border-blue-500">1 hello</div>
<div class="p-2 border-4 border-blue-500">1 hello</div>
<div class="p-2 border-4 border-blue-500">1 hello</div>
<div class="p-2 border-4 border-blue-500">1 hello</div>
</div>
<div class="flex border-4 border-red-300 m-3">
<div class="p-2 border-4 border-blue-500">
2 Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam ab
tenetur eius odio neque possimus? Voluptatibus id sed a quo ipsam harum
earum tempora impedit consectetur, numquam maxime corporis odio?
</div>
<div class="p-2 border-4 border-blue-500">2 hello</div>
<div class="p-2 border-4 border-blue-500">2 hello</div>
<div class="p-2 border-4 border-blue-500">2 hello</div>
</div>
<div class="flex flex-col border-4 border-red-300 m-3">
<div class="p-2 border-4 border-blue-500">
3 Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam ab
tenetur eius odio neque possimus? Voluptatibus id sed a quo ipsam harum
earum tempora impedit consectetur, numquam maxime corporis odio?
</div>
<div class="p-2 border-4 border-blue-500">3 hello</div>
<div class="p-2 border-4 border-blue-500">3 hello</div>
<div class="p-2 border-4 border-blue-500">3 hello</div>
</div>
<div class="flex flex-wrap border-4 border-red-300 m-3">
<div class="p-2 border-4 border-blue-500">
4 Lorem ipsum dolor sit amet consectetur adipisicing elit. Magnam ab
tenetur eius odio neque possimus? Voluptatibus id sed a quo ipsam harum
earum tempora impedit consectetur, numquam maxime corporis odio?
</div>
<div class="p-2 border-4 border-blue-500">4 hello</div>
<div class="p-2 border-4 border-blue-500">4 hello</div>
<div class="p-2 border-4 border-blue-500">4 hello</div>
</div>
<!--
justify-content: center - justify-center
justify-content: space-between - justify-between
align-items: flex-start - items-start
align-items: center - items-center
align-self: auto - self-auto
align-slef: flex-start - self-start
align-slef: flex-end - self-end
flex: 1 1 0% - flex-1
flex: 1 1 auto - flex-auto
flex: 0 1 auto - flex-initial
flex: none - flex-none
-->
<div class="flex flex-wrap border-4 border-red-300 m-3">
<div class="flex-1 p-2 border-4 border-blue-500">5 hello</div>
<div class="flex-1 p-2 border-4 border-blue-500">5 hello</div>
<div class="flex-1 p-2 border-4 border-blue-500">5 hello</div>
<div class="flex-1 p-2 border-4 border-blue-500">5 hello</div>
</div>
<!--
space-x-1 > margin-left: 0.25rem; /* 4px */
space-y-1 > margin-top: 0.25rem; /* 4px */
-->
<div class="flex space-x-1 flex-wrap border-4 border-red-300 m-3">
<div class="w-16 h-16 p-2 border-4 border-blue-500">6 hello</div>
<div class="w-16 h-16 p-2 border-4 border-blue-500">6 hello</div>
<div class="w-16 h-16 p-2 border-4 border-blue-500">6 hello</div>
<div class="w-16 h-16 p-2 border-4 border-blue-500">6 hello</div>
</div>
<!--
gap-px gap: 1px;
gap-x-px column-gap: 1px;
gap-1 gap: 0.25rem; /* 4px */
-->
<div class="flex gap-6 flex-wrap border-4 border-red-300 m-3">
<div class="w-16 h-16 p-2 border-4 border-blue-500">7 hello</div>
<div class="w-16 h-16 p-2 border-4 border-blue-500">7 hello</div>
<div class="w-16 h-16 p-2 border-4 border-blue-500">7 hello</div>
<div class="w-16 h-16 p-2 border-4 border-blue-500">7 hello</div>
</div>
<!-- -m-3 네거티브 마진으로 간격 맞출 수 있음 -->
<div class="flex flex-wrap border-4 border-red-300 m-3">
<div class="w-16 h-16 m-3 p-2 border-4 border-blue-500">8 hello</div>
<div class="w-16 h-16 m-3 p-2 border-4 border-blue-500">8 hello</div>
<div class="w-16 h-16 m-3 p-2 border-4 border-blue-500">8 hello</div>
<div class="w-16 h-16 m-3 p-2 border-4 border-blue-500">8 hello</div>
</div>
<div class="flex border-4 border-red-300 m-3">
<div class="w-3/4 p-2 border-4 border-blue-500">9 hello</div>
<div class="w-1/4 p-2 border-4 border-blue-500">9 hello</div>
</div>
<div class="flex flex-wrap border-4 border-red-300 m-3">
<div class="w-3/4 p-2 border-4 border-blue-500">10 hello</div>
<div class="w-1/4 p-2 border-4 border-blue-500">10 hello</div>
<div class="w-3/4 p-2 border-4 border-blue-500">10 hello</div>
<div class="w-1/4 p-2 border-4 border-blue-500">10 hello</div>
</div>
<div class="flex flex-wrap border-4 border-red-300 m-3">
<div class="w-1/4 p-2 border-4 border-blue-500">11 hello</div>
<div class="w-1/4 p-2 border-4 border-blue-500">11 hello</div>
<div class="w-1/4 p-2 border-4 border-blue-500">11 hello</div>
<div class="w-1/4 p-2 border-4 border-blue-500">11 hello</div>
<div class="w-1/4 p-2 border-4 border-blue-500">11 hello</div>
<div class="w-1/4 p-2 border-4 border-blue-500">11 hello</div>
<div class="w-1/4 p-2 border-4 border-blue-500">11 hello</div>
<div class="w-1/4 p-2 border-4 border-blue-500">11 hello</div>
</div>
<div class="border-4 border-red-300 m-3">
<div class="inline-block p-2 border-4 border-blue-500">12 hello</div>
<div class="inline-block p-2 border-4 border-blue-500">12 hello</div>
<div class="inline-block p-2 border-4 border-blue-500">12 hello</div>
<div class="inline-block p-2 border-4 border-blue-500">12 hello</div>
</div>
<!-- justify-content: space-between -->
<div class="flex justify-between border-4 border-red-300 m-3">
<div class="p-2 border-4 border-blue-500">13 hello</div>
<div class="p-2 border-4 border-blue-500">13 hello</div>
<div class="p-2 border-4 border-blue-500">13 hello</div>
<div class="p-2 border-4 border-blue-500">13 hello</div>
</div>
<!-- justify-content: center -->
<div class="flex justify-center border-4 border-red-300 m-3">
<div class="p-2 border-4 border-blue-500">14 hello</div>
<div class="p-2 border-4 border-blue-500">14 hello</div>
<div class="p-2 border-4 border-blue-500">14 hello</div>
<div class="p-2 border-4 border-blue-500">14 hello</div>
</div>
<div
class="flex justify-center items-center w-80 h-80 border-4 border-red-300 m-3"
>
<div class="text-center leading-9 w-32 h-16 p-2 border-4 border-blue-500">
15 hello
</div>
</div>
<!-- 접근성과 모바일 고려 -->
<div class="flex md:flex-row flex-col border-4 border-red-300 m-3">
<div class="p-2 flex-1 border-4 border-blue-500 order-1">1 hello</div>
<div class="p-2 flex-1 border-4 border-blue-500 order-0">2 hello</div>
<div class="p-2 flex-1 border-4 border-blue-500 order-2">3 hello</div>
<div class="p-2 flex-1 border-4 border-blue-500 order-3">4 hello</div>
</div>
<div class="flex md:flex-row flex-col border-4 border-red-300 m-3">
<div class="p-2 flex-1 border-4 border-blue-500">1 hello</div>
<div
class="p-2 flex-1 border-4 border-blue-500 order-first md:order-none"
>
2 hello
</div>
<div class="p-2 flex-1 border-4 border-blue-500">3 hello</div>
<div class="p-2 flex-1 border-4 border-blue-500">4 hello</div>
</div>
<div class="flex border-4 border-red-300 m-3">
<div class="p-2 border-4 border-blue-500">
<div class="w-32 h-32 bg-blue-400 rounded-full"></div>
</div>
<div class="p-2 border-4 border-blue-500">18 hello</div>
<div class="p-2 border-4 border-blue-500">18 hello</div>
<div class="p-2 border-4 border-blue-500">18 hello</div>
</div>
<div class="flex border-4 border-red-300 m-3">
<div class="w-32 h-32 bg-blue-400 rounded-full"></div>
<div class="p-2 border-4 border-blue-500">19 hello</div>
<div class="p-2 border-4 border-blue-500">19 hello</div>
<div class="p-2 border-4 border-blue-500">19 hello</div>
</div>
<div class="flex border-4 border-red-300 m-3">
<div class="w-32 h-32 bg-blue-400 rounded-full flex-shrink-0"></div>
<div class="p-2 border-4 border-blue-500">19 hello</div>
<div class="p-2 border-4 border-blue-500">19 hello</div>
<div class="p-2 border-4 border-blue-500">19 hello</div>
</div>
</body>
</html>