-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathflexbox.html
108 lines (77 loc) · 2.01 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title> Basics of CSS flexbox </title>
<link rel="stylesheet" href="css/normalize.min.css">
<link rel="stylesheet" href="css/flexbox.css">
</head>
<body>
<div id="wrapper">
<h1>Basics of CSS flexbox</h1>
<p>Flexbox is ideally suited for a set of smaller elements — often DIVs — that have to fill or fit within a particular space on the page. A set of elements (flex items) is wrapped in a container with the <code>display: flex</code> declaration in its CSS rule.</p>
<div class="flexcontainer">
<div class="fbutton">
Rama
</div>
<div class="fbutton">
Sita
</div>
<div class="fbutton">
Hanuman
</div>
<div class="fbutton">
Lakshmana
</div>
<div class="fbutton">
Ravana
</div>
<!-- close the flexcontainer -->
</div>
<p>Here's a variation, using a slightly smaller font-size.</p>
<div class="flexcontainer">
<div class="fbutton smallish">
Rama
</div>
<div class="fbutton smallish">
Sita
</div>
<div class="fbutton smallish">
Hanuman
</div>
<div class="fbutton smallish">
Lakshmana
</div>
<div class="fbutton smallish">
Ravana
</div>
<!-- close the flexcontainer -->
</div>
<p>And another variation, adding a sixth element into the set.</p>
<div class="flexcontainer">
<div class="fbutton">
Sugriva
</div>
<div class="fbutton">
Rama
</div>
<div class="fbutton">
Sita
</div>
<div class="fbutton">
Hanuman
</div>
<div class="fbutton">
Lakshmana
</div>
<div class="fbutton">
Ravana
</div>
<!-- close the flexcontainer -->
</div>
<p>Note that to lay out an entire page, you would be advised to use <a href="grid.html">CSS grid</a> instead of flexbox. Flexbox governs elements along only one axis, either horizontal or vertical. Grid provides control along both axes.</p>
<p class="centered"><a href="index.html">index</a> | <a href="https://github.com/macloo/html_css_templates">GitHub</a></p>
</div>
</body>
</html>