forked from xBlueCode/tut-css-grids-layout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grids-tut.html
208 lines (185 loc) · 8.39 KB
/
grids-tut.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<!DOCTYPE html>
<html>
<head>
<title>Grids Tutorial</title>
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="grids-tut-style.css">
</head>
<body id="top-page" onresize="updateWidth()">
<!-- Start, Nav Bar -->
<nav>
<div class="card navbar">
<div class="logo"> CSS Grids</div>
<div class="navlist">
<!-- <ul class="ulnav">
<li class="linav"><a href="#top-page" class="anav">HOME</a></li>
<li class="linav"><a href="" class="anav">PROJECTS</a></li>
<li class="linav"><a href="" class="anav">ABOUT</a></li>
<li class="linav"><a id="fb" href="" class="anav">fb</a></li>
</ul>-->
</div>
</div>
</nav>
<!-- End, Nav Bar -->
<div class="title-container card">
<h1 class="title ">
CSS Grids Tutorial
</h1>
</div>
<content>
<div class="showcase card" onresize="onresizeTask()">
<div class="showcase-title">
<h2>Without CSS Grids</h2>
</div>
<div class="showcase-container">
<div class="card card-element card-colored-1 Without-grids"><div class="width-bar"> 640 px</div>1</div>
<div class="card card-element card-colored-2 Without-grids"><div class="width-bar"> 640 px</div>2</div>
<div class="card card-element card-colored-3 Without-grids"><div class="width-bar"> 640 px</div>3</div>
<div class="card card-element card-colored-4 Without-grids"><div class="width-bar"> 640 px</div>4</div>
<div class="card card-element card-colored-5 Without-grids"><div class="width-bar"> 640 px</div>5</div>
<div class="card card-element card-colored-6 Without-grids"><div class="width-bar"> 640 px</div>6</div>
</div>
</div>
<div class="showcase card">
<div class="showcase-title">
<h2>CSS Grids - Basic (1)</h2>
<h3>Fixed width and height</h3>
</div>
<div class="showcase-container grid grid1">
<div class="card card-element card-colored-1"><div class="width-bar"> 640 px</div>1</div>
<div class="card card-element card-colored-2"><div class="width-bar"> 640 px</div>2</div>
<div class="card card-element card-colored-3"><div class="width-bar"> 640 px</div>3</div>
<div class="card card-element card-colored-4"><div class="width-bar"> 640 px</div>4</div>
<div class="card card-element card-colored-5"><div class="width-bar"> 640 px</div>5</div>
<div class="card card-element card-colored-6"><div class="width-bar"> 640 px</div>6</div>
</div>
</div>
<div class="showcase card">
<div class="showcase-title">
<h2>CSS Grids - Basic (2)</h2>
<h3>Flexible width | fixed height</h3>
<p>Using fractions (fr unit)</p>
</div>
<div class="showcase-container grid grid2">
<div class="card card-element card-colored-1"><div class="width-bar"> 640 px</div>1</div>
<div class="card card-element card-colored-2"><div class="width-bar"> 640 px</div>2</div>
<div class="card card-element card-colored-3"><div class="width-bar"> 640 px</div>3</div>
<div class="card card-element card-colored-4"><div class="width-bar"> 640 px</div>4</div>
<div class="card card-element card-colored-5"><div class="width-bar"> 640 px</div>5</div>
<div class="card card-element card-colored-6"><div class="width-bar"> 640 px</div>6</div>
</div>
</div>
<div class="showcase card">
<div class="showcase-title">
<h2>CSS Grids - Basic (3)</h2>
<h3>Flexible width | fixed height</h3>
<p>Using 'auto' and fractions 'fr'</p>
</div>
<div class="showcase-container grid grid3">
<div class="card card-element card-colored-1"><div class="width-bar"> 640 px</div>1</div>
<div class="card card-element card-colored-2"><div class="width-bar"> 640 px</div>2</div>
<div class="card card-element card-colored-3"><div class="width-bar"> 640 px</div>3</div>
<div class="card card-element card-colored-4"><div class="width-bar"> 640 px</div>4</div>
<div class="card card-element card-colored-5"><div class="width-bar"> 640 px</div>5</div>
<div class="card card-element card-colored-6"><div class="width-bar"> 640 px</div>6</div>
</div>
</div>
<div class="showcase card">
<div class="showcase-title">
<h2>CSS Grids - Basic (4)</h2>
<h3>Flexible width | fixed height</h3>
<p>Using minmax() and fractions 'fr'</p>
</div>
<div class="showcase-container grid grid4">
<div class="card card-element card-colored-1"><div class="width-bar"> 640 px</div>1</div>
<div class="card card-element card-colored-2"><div class="width-bar"> 640 px</div>2</div>
<div class="card card-element card-colored-3"><div class="width-bar"> 640 px</div>3</div>
<div class="card card-element card-colored-4"><div class="width-bar"> 640 px</div>4</div>
<div class="card card-element card-colored-5"><div class="width-bar"> 640 px</div>5</div>
<div class="card card-element card-colored-6"><div class="width-bar"> 640 px</div>6</div>
</div>
</div>
<div class="showcase card">
<div class="showcase-title">
<h2>CSS Grids - Position (5)</h2>
<h3>Positioning grid items</h3>
<p>Using grid-column-(start/end)</p>
</div>
<div class="showcase-container grid grid5">
<div class="card card-element card-colored-1"><div class="width-bar"> 640 px</div>1</div>
<div class="card card-element card-colored-2"><div class="width-bar"> 640 px</div>2</div>
<div class="card card-element card-colored-3"><div class="width-bar"> 640 px</div>3</div>
<div class="card card-element card-colored-4"><div class="width-bar"> 640 px</div>4</div>
<div class="card card-element card-colored-5"><div class="width-bar"> 640 px</div>5</div>
<div class="card card-element card-colored-6"><div class="width-bar"> 640 px</div><div class="width-bar"> 640 px</div>6</div>
</div>
</div>
<div class="showcase card">
<div class="showcase-title">
<h2>CSS Grids - Position (6)</h2>
<h3>Positioning grid items</h3>
<p>Using areas</p>
</div>
<div class="showcase-container grid grid6">
<div class="card card-element card-colored-1"><div class="width-bar"> 640 px</div>1</div>
<div class="card card-element card-colored-2"><div class="width-bar"> 640 px</div>2</div>
<div class="card card-element card-colored-3"><div class="width-bar"> 640 px</div>3</div>
<div class="card card-element card-colored-4"><div class="width-bar"> 640 px</div>4</div>
<div class="card card-element card-colored-5"><div class="width-bar"> 640 px</div>5</div>
<div class="card card-element card-colored-6"><div class="width-bar"> 640 px</div>6</div>
</div>
</div>
<div class="showcase card">
<div class="showcase-title">
<h2>CSS Grids - Auto-fitting (7)</h2>
<h3>Handling auto fitting</h3>
<p>Using auto-fit and minmax()</p>
</div>
<div class="showcase-container grid grid7">
<div class="card card-element card-colored-1"> <div class="width-bar"> 640 px</div>1</div>
<div class="card card-element card-colored-2"><div class="width-bar"> 640 px</div>2</div>
<div class="card card-element card-colored-3"><div class="width-bar"> 640 px</div>3</div>
<div class="card card-element card-colored-4"><div class="width-bar"> 640 px</div>4</div>
<div class="card card-element card-colored-5"><div class="width-bar"> 640 px</div>5</div>
<div class="card card-element card-colored-6"><div class="width-bar"> 640 px</div>6</div>
</div>
</div>
<div class="showcase card">
<div class="showcase-title">
<h2>CSS Grids - Bonus (1)</h2>
<h3>Responsive website prototype</h3>
<p>Using areas and media queries</p>
</div>
<div class="showcase-container grid grid-pro1">
<div class="card card-element card-colored-1">
<div class="width-bar"> 640 px</div>
<div>Header</div>
</div>
<div class="card card-element card-colored-2">
<div class="width-bar"> 640 px</div>
<div>Menu</div>
</div>
<div class="card card-element card-colored-3">
<div class="width-bar"> 640 px</div>
<div>Content</div>
</div>
<div class="card card-element card-colored-4">
<div class="width-bar"> 640 px</div>
<div>Footer</div>
</div>
</div>
</div>
<script type="text/javascript">
window.onresize = function(){
widthBars = document.getElementsByClassName("width-bar");
for (i=0; i<widthBars.length; i++) {
widthBars[i].innerHTML = widthBars[i].parentNode.offsetWidth + " px";
}
}
window.onstart = window.onresize();
</script>
</content>
<div class="card">
</div>
</body>
</html>