-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlec28.html
86 lines (73 loc) · 2.66 KB
/
lec28.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
85
86
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flexbox</title>
<style>
.container{
display: flex;
height: 344px;
width: 100%;
border: 2px solid rgb(0, 0, 0);
/* Flex properies for flex container */
flex-direction: row-reverse;
flex-direction: column;
flex-direction: column-reverse;
flex-direction: row; /* default value is row */
/* to make the container items wrap in a responsive way, use flex-wrap: wrap; property */
flex-wrap: wrap-reverse; /*Wraps the items of flexbox in reverse(anticlockwise direction)*/
flex-wrap: wrap;
/* flex-flow: is used to define two properties in a single line, flex-direction and flex wrap */
/* flex-flow: column wrap-reverse; */
/* justify content is used to align flex elements in a spscific order */
/* justify-content: center;
justify-content: space-around;
justify-content: space-between;
justify-content: space-evenly; */
align-items: center;
align-items: flex-end;
align-items: flex-start;
align-items: stretch;
}
.item{
background-color: tomato;
border: 2px solid rgb(0, 38, 255);
margin: 10px;
padding: 2px;
width: 200px;
height: 200px;
/* Higher the order, later it will be visible in the container */
}
#item1{
order: 2;
/* flex-grow: 3; */
/*Flex item grows in size*/
/* flex-shrink: 3; */
/* When flex direction is set to row, flex basis changes the width */
/* And when flex direction is set to column, the flex basis will alter the height */
flex-basis: 120px;
}
#item2{
order: 1;
}
#item3{
/* flex: is a shorthand through which we can change flex grow, flex shrink and flex basis at a single time */
/* flex: 3 3 150px; */
align-self: center;
}
</style>
</head>
<body>
<h1>This is 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>