-
Notifications
You must be signed in to change notification settings - Fork 1
/
2-3_flex-advance.html
55 lines (53 loc) · 1.19 KB
/
2-3_flex-advance.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
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="./style.css">
<title>CSSがちょっと楽しくなる会</title>
<style>
.flex {
border: 2px solid #41337A;
padding: 20px;
width: 600px;
/* flexに関する指定 */
display: flex;
justify-content: space-around;
}
.flex-item {
background: #41337A;
padding: 10px;
font-size: 20px;
line-height: 1em;
color: #FFFFFF;
/* flexに関する指定 */
flex-basis: 100px; /* ポジティブスペースは 600 - (120 * 3) = 240px */
}
.flex-item._1 {
flex-grow: 10;
}
.flex-item._2 {
opacity: .7;
flex-grow: 4;
}
.flex-item._3 {
flex-grow: 10;
}
</style>
</head>
<body>
<article>
<header>
<h1>flex box</h1>
</header>
<main>
<div class="flex">
<div class="flex-item _1">item</div>
<div class="flex-item _2">item</div>
<div class="flex-item _3">item</div>
</div>
</main>
</article>
</body>
</html>