-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tut21.html
84 lines (77 loc) · 2.7 KB
/
Tut21.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flexbox</title>
<style>
.container{
height: 400px;
width: 100%;
border: 2px solid yellowgreen;
/* initialise the container as flex */
display: flex;
/* properties for flex container */
flex-direction: row; /* It is default */
flex-direction: column;
/* flex-wrap:wrap; */
/* Default value for flex-wrap:no-wrap */
/* flex-wrap: wrap-reverse; */
/* flex-flow: row-reverse wrap; */
/* shorthand we write both direction and wrap in one line using flex-flow */
/* justify-content: center; */
/* justify-content: space-between; */
/* justify-content: space-around; */
/* justify-content: space-evenly; */
/* align-items: center; */
/* align-items: flex-end; */
/* align-items: flex-start; */
/* align-items: stretch; */
/* it is for responsive website */
}
.item{
background-color: thistle;
margin: 5px;
padding: 3px;
border: rgb(7, 245, 78) solid 2px;
height: 80px;
width: 80px;
}
#item-1{
/* Flex properties for flex items */
/* Higer the order it shows end in the container */
/* order: 3; */
/* flex-grow: 4; */
/* flex-shrink: 2; */
}
#item-2{
/* order: 1; */
/* flex-grow: 2; */
/* flex-shrink: 13; */
/* flex-basis control width if flex direction: set to row */
/* flex-basis control hieght if flex direction: set to column */
/* flex-basis: 150px; */
align-self: flex-end;
}
#item-3{
/* order: 2; */
/* flex-grow: 3; */
/* flex-basis: 150px; */
/* Below is shorthnd for flex items to set flex-grow,flex-shrink,flex-basis */
/* flex:0 100 200px ; */
align-self: center;
}
</style>
</head>
<body>
<h1>This is Flexbox</h1>
<div class="container">
<div class="item" id="item-1">First Box</div>
<div class="item" id="item-2">Second Box</div>
<div class="item" id="item-3">Third Box</div>
<!-- <div class="item" id="item-4">Fourth Box</div>
<div class="item" id="item-5">Fifth Box</div>
<div class="item" id="item-6">Sixth Box</div> -->
</div>
</body>
</html>