-
Notifications
You must be signed in to change notification settings - Fork 1
/
Align-Self.html
51 lines (51 loc) · 1.26 KB
/
Align-Self.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flexbox Align-Self Example</title>
<style>
.container {
display: flex;
justify-content: center;
align-items: flex-start;
gap: 10px;
padding: 20px;
background-color: #f0f0f0;
height: 300px;
}
.box {
width: 100px;
height: 100px;
background-color: #4CAF50;
color: white;
display: flex;
justify-content: center;
align-items: center;
font-weight: bold;
border: 2px solid #000;
}
.box1 {
align-self: flex-start;
}
.box2 {
align-self: center;
}
.box3 {
align-self: flex-end;
}
.box4 {
align-self: stretch;
}
</style>
</head>
<body>
<h2>Flexbox Align-Self Example</h2>
<div class="container">
<div class="box box1">Box 1</div>
<div class="box box2">Box 2</div>
<div class="box box3">Box 3</div>
<div class="box box4">Box 4</div>
</div>
</body>
</html>