-
Notifications
You must be signed in to change notification settings - Fork 0
/
Flex_Box.html
151 lines (111 loc) Β· 3.88 KB
/
Flex_Box.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!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{
background-color:rgb(238, 238, 109) ;
border: solid rgb(226, 11, 11) 6px ;
height:250px;
display:flex;
/* flex-direction: column-reverse; */
/* flex-direction: row-reverse; */
flex-direction: row;
/* Importent
If the flex direction is row wise then cross axix will column wise it means its start point will
be on top and end point will be on bottom side */
/* flex-wrap: wrap; */
/* flex-flow:wrap ; */
/* allign-content is used to reduce the gap between two items when the are wrapped */
/* align-content: start;
*/
/* justify-content helps to allign the content */
/* justify-content: center; */
/* justify-content:center; */
justify-content:center;
/* align-items:center; */
align-items:center;
/* align-items:start; */
/* align-items:center; */
/* flex-shrink: 1; */
/* flex-shrink is use to reduce the shrinking speed of whole
container or of a specific container(such as div) */
/* flex-grow is used to speedup the size growing speed of whole
container or of a specific container (such as div) */
/* flex-grow: 1px; */
/* align-self: ; is used to align the container or div any */
}
#p{
/* height: 100px;
border:solid red 1px ;
width:100px; */
background-color: rgb(207, 11, 70);
/* margin:2px;
padding:2px; */
/* flex-shrink: 4; */
/* flex-grow: 4; */
align-self: center;
/* order: 3; */
}
#l{
/* height: 100px;
width:100px; */
border:solid rgb(12, 27, 230) 4px ;
background-color: rgb(24, 216, 7);
/* margin:2px;
padding:2px; */
/* flex-shrink: 1; */
/* flex-grow: 1px; */
align-self: center;
/* order: 1; */
}
#x{
/* height: 100px; */
background-color: rgb(29, 105, 10);
border:solid rgb(0, 4, 221) 4px ;
/* width:100px;
margin:2px;
padding:2px; */
/* flex-shrink: 1; */
/* flex-grow: 1px; */
align-self: center;
}
#z{
background-color: rgb(156, 12, 137);
border:solid rgb(0, 4, 221) 4px ;
/* height: 100px; */
/* width:100px;
margin:2px;
padding:2px; */
/* flex-shrink: 1; */
/* flex-grow: 1px; */
/* flex-basis: 500px; */
/* flex-basis is used to increase the size of container or box */
align-self: center;
order: 1;
}
.box1{
/* to see the stretch effect uncommet the height attribute */
height: 100px;
border:solid rgb(28, 10, 189) 4px ;
width:100px;
background-color: rgb(4, 130, 168);
margin:2px;
padding:2px;
}
</style>
</head>
<body>
<div id="container">
<div class="box1" id="p"></div>
<div class="box1" id="l"></div>
<div class="box1" id="z"></div>
<div class="box1" id="x"></div>
</div>
align-items:center;
justify-content:center;
justify-content:center;
</body>
</html>