-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtut23.html
97 lines (80 loc) · 3.03 KB
/
tut23.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
<!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 in CSS</title>
<!-- flexbox is a one dimensional layout
method for laying out items in rows or columns
css flexbox is a better way to align items into
container-->
<style>
.container {
height: 544px;
width: 100%;
border: 2px solid black;
display: flex;
/* Initialize the container as a flex box */
/* Flex properties for a flex container */
/* flex-direction: row; (Default value of flex-direction is row) */
/* flex-direction: column;
flex-direction: row-reverse;
flex-direction: column-reverse; */
/* flex-wrap: wrap; (Default value of flex-direction is no-wrap) */
/* flex-wrap: wrap-reverse; */
/* This is a shorthand for flex-direction: and flex-wrap: ;; */
/* flex-flow: row-reverse wrap; */
/* justify-content will justify the content in horizontal direction */
/* justify-content: center; */
/* justify-content: space-between; */
/* justify-content: space-evenly; */
/* justify-content: space-around; */
/* justify-content will justify the content in vertical direction */
/* align-items: center; */
/* align-items: flex-end; */
/* align-items: flex-start; */
/* align-items: stretch; */
}
.item {
width: 200px;
height: 200px;
background-color: tomato;
border: 2px solid green;
margin: 10px;
padding: 3px;
}
#item-1 {
/* Flex properties for a flex item */
/* Higher the order, later it shows up in the container */
/* order: 2; */
flex-grow: 2;
flex-shrink: 2;
}
#item-2 {
/* flex-grow: 3;
flex-shrink: 3 ; */
flex-basis: 160px;
/* when flex-direction is set to row flex-basis: will control width */
/* when flex-direction is set to column flex-basis: will control height */
}
#item-3 {
/* flex: 2 2 230px; */
align-self: flex-start;
align-self: flex-end;
align-self: center;
}
</style>
</head>
<body>
<h1>This is Flexbox Tutorial</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>