-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflextut.html
More file actions
93 lines (76 loc) · 2.1 KB
/
flextut.html
File metadata and controls
93 lines (76 loc) · 2.1 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
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flexbox Tutorial</title>
<style>
.container{
height: 344px;
width: 100%;
border: 2px solid red;
/* Initialize the conatiner as the flex box */
display: flex;
/* Flex properties for flex container */
/* (default value of flex direction: ;) */
flex-direction: row;
/* flex-direction: column;
flex-direction: row-reverse;
flex-direction: column-reverse; */
flex-wrap: wrap
; /* flex-wrap: nowrap;(default value of wrap ) */
/* flex-wrap: wrap-reverse; */
/* Shortand for direction and wrap */
/* flex-flow: row-reverse wrap; */
/* justify-content: center;
justify-content: space-between;
justify-content: space-evenly;
justify-content: space-around; */
/* align-items: center; /* used to center vertically */
/* align-items: flex-start;
align-items: flex-end;
align-items: stretch; */
}
.item{
width: 200px;
height: 200px;
background-color:tomato;
border: 5px solid green;
margin: 10px;
padding: 3px;
}
#item1{
/* flex properties for flex items */
/* higher the order later it shows up in the container */
/* order: 2; */
/* flex-shrink: 2; */
/* flex-grow: 2 ; */
}
#item2{
/* order: 40; */
/* flex-grow: 4; */
/* flex-shrink: 5; */
/* When flex direction is set to row flex basis will control the width */
/* When flex direction is set to column flex basis will control the height */
flex-basis: 320px;
}
#item3{
flex: 2 3 344px;
align-self: center;
align-self: flex-start;
align-self: flex-end;
}
</style>
</head>
<body>
<h1>This is A flexbox tutorial</h1>
<div class="container">
<div class="item" id="item1">First box </div>
<div class="item" id="item2">Second box </div>
<div class="item" id="item3">Third box</div>
<!-- <div class="item" id="item4">fourth box</div>
<div class="item" id="item5">Fifth box </div>
<div class="item" id="item6">Sixth box</div> -->
</div>
</body>
</html>