-
Notifications
You must be signed in to change notification settings - Fork 0
/
FlexBox.html
42 lines (38 loc) · 1.25 KB
/
FlexBox.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
<!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 {
height: 400px;
border: 2px solid black;
display: flex;j
/* flex-direction: row; */
flex-wrap: wrap;
/* flex flow is used to write flex direction and flex wrap both in the same property, i.e. it is a short hand notation */
/* flex-flow: row wrap; */
justify-content: center;/*justify content is used to provide space, or to put the content on the side of the container*/
align-items: center;
/* To put the content in center just set justify content and align items to center */
gap: 10px;
align-content: space-evenly;
}
.box {
border: 1px solid brown;
background-color: aqua;
width: 50px;
}
</style>
</head>
<body>
<div class="container">
<div class="box">box1</div>
<div class="box">box2</div>
<div class="box">box3</div>
<div class="box">box4</div>
</div>
</body>
</html>