-
Notifications
You must be signed in to change notification settings - Fork 0
/
fle_x.html
92 lines (84 loc) · 2.98 KB
/
fle_x.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
h1 {
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
color:blueviolet;
text-align:center;
}
body {
font-family: 'Courier New', Courier, monospace;
font-weight: bold;
}
.blue-axis {
background-color: blue;
width: 500px;
height: 2px;
position: absolute;
top: 335px;
left: 13px;
}
.green-axis {
background-color: green;
width: 2px;
height: 500px;
position: absolute;
top:85px;
left: 263px;
}
.box-container {
border: 5px solid black;
width: 500px;
height: 500px;
display: flex;
/* flex-direction: row;* /*flex-direction: by default it is row*/
/*justify-content: flex-end; /* centered horizontal based on flex-direction;
if it was column then it is in the vertical direction*/
/* space-around gives space sinetbween the boxes, spaces at the edge wil become 0 and the rest will be evenly spaced.
space-evenly| flex-end puts the items at the end of the container. flex-start the opposite of flex-end.*/
/* align-items: center;1*/ /*baseline for align-items aligns them around a base line*/
/* flex-wrap:wrap; /*default is not wrapping*/
/*align-content: center; /* does it along the horizontal axis? */
/* when ever there is a wrap with justify content we use align content and not align
items.*/
gap: 10px;/* gap/margin only between the boxes*/
}
.box {
border: 2px solid red;
background-color: lightcoral;
height: 75px;
width: 75px;
text-align: center;
}
#box-1{
order: 3; /* changes order thogh oddly*/
flex-grow: 1;}
#box-2{
flex-grow: 2;
}
#box-3 {
align-self: center; /* aligns individual boxes within container*/
flex-grow: 3;
flex-shrink: 0;
flex-basis: 100px;
}
</style>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="javascriptfun/ex-01s.js"></script>
</head>
<body>
<h1>Flexbox</h1>
<div class="box-container">
<div class="box" id="box-1">box 1</div>
<div class="box" id="box-2">box 2</div>
<div class="box" id="box-3">box 3</div>
</div>
<div class="green-axis"></div>
<div class="blue-axis"></div>
</body>
</html>