-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflex.html
More file actions
83 lines (75 loc) · 2.06 KB
/
Copy pathflex.html
File metadata and controls
83 lines (75 loc) · 2.06 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
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html lang="en">
<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">
<title>Document</title>
<!--
https://developer.mozilla.org/zh-CN/docs/Web/CSS/CSS_Flexible_Box_Layout/Using_CSS_flexible_boxes
http://learnlayout.com/flexbox.html
https://css-tricks.com/snippets/css/a-guide-to-flexbox/
-->
<style>
.container {
display: -webkit-flex;
display: flex;
border: 1px solid red;
box-sizing: border-box;
overflow: hidden;
}
.initial {
-webkit-flex: initial;
flex: initial;
width: 300px;
max-width: 300px;
box-sizing: border-box;
background: #0f0;
transition: all ease-out 0.5s 0.1s;
}
@media all and (max-width: 720px) {
.initial {
-webkit-flex: initial;
flex: initial;
width: 50px;
max-width: 50px;
box-sizing: border-box;
background: #ccc;
transition: all ease-in 0.5s 0.1s;
color: aquamarine;
}
}
.none {
-webkit-flex: none;
flex: none;
width: 200px;
}
.flex1 {
-webkit-flex: 1;
flex: 1;
box-sizing: border-box;
background: #f0f;
}
.flex2 {
-webkit-flex: 2;
flex: 2;
}
</style>
</head>
<body>
<h1>flex</h1>
<hr>
<div class="container">
<nav class="initial">
<ul>
<li>li1</li>
<li>li2</li>
<li>li3</li>
</ul>
</nav>
<section class="flex1">
flex 1
</section>
</div>
</body>
</html>