-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclass6.html
443 lines (401 loc) · 21.9 KB
/
class6.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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Girl Develop It - Intro to HTML + CSS, Class 6</title>
<meta name="description" content="Girl Develop It's Intro to HTML and CSS course, customized by Cara Jo Miller">
<meta name="author" content="Cara Jo Miller">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/simple.css" id="theme">
<link rel="stylesheet" href="css/slides.css">
<!-- For syntax highlighting -->
<!-- light editor<link rel="stylesheet" href="lib/css/light.css">-->
<!-- dark editor-->
<link rel="stylesheet" href="lib/css/dark.css">
<link rel="stylesheet" href="lib/css/zenburn.css">
<link rel="stylesheet" href="plugin/accessibility-helper/css/accessibility-helper.css">
<!-- If the query includes 'print-pdf', include the PDF print sheet -->
<script>
if (window.location.search.match(/print-pdf/gi)) {
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'css/print/pdf.css';
document.getElementsByTagName('head')[0].appendChild(link);
}
</script>
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>
<!-- If use the PDF print sheet so students can print slides-->
<link rel="stylesheet" href="css/print/pdf.css" type="text/css" media="print">
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<div class="slides">
<!-- Code Your Own Website -->
<section>
<h2>HTML / CSS 4wk series</h2>
<img src="img/circle-gdi-logo.png" alt="GDI Logo" />
<h3>Intermediate CSS </h3>
<p>
<small>Session 6</small>
</p>
</section>
<section data-background="#f05b62">
<h1 style="color: #fafafa;">Intermediate CSS!</h1>
</section>
<section data-background="#f05b62">
<h1 style="color: #fafafa;">Background-image</h1>
</section>
<section>
<h3>Background Image</h3>
<p>We can add background images to divs just like we do background colors.</p>
<p data-height="500" data-theme-id="32989" data-slug-hash="NYXQNy" data-default-tab="css,result" data-user="gdiboulder" data-embed-version="2" data-pen-title="Background-Image" class="codepen">See the Pen <a href="https://codepen.io/gdiboulder/pen/NYXQNy/">Background-Image</a> by Girl Develop It Boulder/Denver (<a href="https://codepen.io/gdiboulder">@gdiboulder</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<small><a href="https://codepen.io/gdiboulder/pen/NYXQNy/" target="_blank">Interact with this example.</a></small>
</section>
<section>
<h3>Background-size</h3>
<p>We can adjust the size of the image by using a property called:
<code>background-size</code>
</p>
<p data-height="325" data-theme-id="32989" data-slug-hash="QmQLmw" data-default-tab="css,result" data-user="gdiboulder" data-embed-version="2" data-pen-title="Background-size" class="codepen">See the Pen <a href="https://codepen.io/gdiboulder/pen/QmQLmw/">Background-size</a> by Girl Develop It Boulder/Denver (<a href="https://codepen.io/gdiboulder">@gdiboulder</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<small><a href="https://codepen.io/gdiboulder/pen/QmQLmw/" target="_blank">Interact with this example.</a></small>
<p>
We can apply a value of "<code>cover</code>" so that we can scale the image to the largest size such that both its width and its height can fit inside the content area.</p>
</section>
<section>
<h3>Advanced Codepen: Background-Attachment</h3>
<p>If you're feeling bold you can check out this slightly more advanced codepen that uses the background-attachment property.</p>
<p data-height="325" data-theme-id="32989" data-slug-hash="OvQWxM" data-default-tab="css,result" data-user="gdiboulder" data-embed-version="2" data-pen-title="Background-size" class="codepen">See the Pen <a href="https://codepen.io/gdiboulder/pen/QmQLmw/">Background-size</a> by Girl Develop It Boulder/Denver (<a href="https://codepen.io/gdiboulder">@gdiboulder</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<small><a href="https://codepen.io/gdiboulder/pen/OvQWxM" target="_blank">Interact with this example.</a></small>
</section>
<section>
<h3>Develop It!</h3>
<p>Let's add a background image to a div. In the example we added a background image to the header.
</section>
<section data-background="#f05b62">
<h1 style="color: #fafafa;">CSS Gradients</h1>
</section>
<section>
<h2>Gradients</h2>
<p>Build gradients with CSS - because doing it with images is annoying! </p>
</section>
<section>
<h2>Linear gradients</h2>
<p>An extreme example of how many colors you can use! It's unlimited!</p>
<p data-height="500" data-theme-id="32989" data-slug-hash="oqpKLb" data-default-tab="css,result" data-user="gdiboulder" data-embed-version="2" data-pen-title="Linear Gradients" class="codepen">See the Pen <a href="https://codepen.io/gdiboulder/pen/oqpKLb/">Linear Gradients</a> by Girl Develop It Boulder/Denver (<a href="https://codepen.io/gdiboulder">@gdiboulder</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<small><a href="https://codepen.io/gdiboulder/pen/oqpKLb/" target="_blank">Interact with this example.</a></small>
</section>
<section>
<h2>Linear gradients</h2>
<p>A more suble example using two colors.</p>
<p data-height="500" data-theme-id="32989" data-slug-hash="MVQWRB" data-default-tab="css,result" data-user="gdiboulder" data-embed-version="2" data-pen-title="Linear Gradients - two color" class="codepen">See the Pen <a href="https://codepen.io/gdiboulder/pen/MVQWRB/">Linear Gradients - two color</a> by Girl Develop It Boulder/Denver (<a href="https://codepen.io/gdiboulder">@gdiboulder</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<small><a href="https://codepen.io/gdiboulder/pen/MVQWRB/" target="_blank">Interact with this example.</a></small>
</section>
<section>
<h2>Radial gradients</h2>
<p data-height="500" data-theme-id="32989" data-slug-hash="pLpMbx" data-default-tab="css,result" data-user="gdiboulder" data-embed-version="2" data-pen-title="Radial Gradients - multi-color" class="codepen">See the Pen <a href="https://codepen.io/gdiboulder/pen/pLpMbx/">Radial Gradients - multi-color</a> by Girl Develop It Boulder/Denver (<a href="https://codepen.io/gdiboulder">@gdiboulder</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<small><a href="https://codepen.io/gdiboulder/pen/pLpMbx/" target="_blank">Interact with this example.</a></small>
</section>
<section>
<h2>Radial gradients</h2>
<p data-height="500" data-theme-id="32989" data-slug-hash="XEZNrm" data-default-tab="css,result" data-user="gdiboulder" data-embed-version="2" data-pen-title="Radial Gradients - two color" class="codepen">See the Pen <a href="https://codepen.io/gdiboulder/pen/XEZNrm/">Radial Gradients - two color</a> by Girl Develop It Boulder/Denver (<a href="https://codepen.io/gdiboulder">@gdiboulder</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<small><a href="https://codepen.io/gdiboulder/pen/XEZNrm/" target="_blank">Interact with this example.</a></small>
</section>
<section>
<h2>CSS gradients are a pain to do from scratch</h2>
<p>That's why people have made things like the <a href="http://www.colorzilla.com/gradient-editor/" target="_blank">Ultimate CSS Gradient Generator</a> to make our lives easier!</p>
</section>
<section>
<h3>Develop It!</h3>
<p>Add a background gradient to a section of your site</p>
</section>
<section data-background="#f05b62">
<h1 style="color: #fafafa;">Border Radius</h1>
</section>
<section>
<h3>Border-Radius</h3>
<p>Simply put, allows you to create rounded corners on boxes.</p>
<p>Designers rejoice!</p>
</section>
<section>
<h3>Border-radius</h3>
<p>20px radius on all corners</p>
<p data-height="500" data-theme-id="32989" data-slug-hash="bvaXZQ" data-default-tab="css,result" data-user="gdiboulder" data-embed-version="2" data-pen-title="Border Radius" class="codepen">See the Pen <a href="https://codepen.io/gdiboulder/pen/bvaXZQ/">Border Radius</a> by Girl Develop It Boulder/Denver (<a href="https://codepen.io/gdiboulder">@gdiboulder</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<small><a href="https://codepen.io/gdiboulder/pen/bvaXZQ/" target="_blank">Interact with this example.</a></small>
</section>
<section>
<h3>Border-radius</h3>
<p>10px radius on top left & bottom right</p>
<p>40px on top right & bottom left</p>
<p data-height="500" data-theme-id="32989" data-slug-hash="EEQNZZ" data-default-tab="css,result" data-user="gdiboulder" data-embed-version="2" data-pen-title="Border-Radius - Two Values" class="codepen">See the Pen <a href="https://codepen.io/gdiboulder/pen/EEQNZZ/">Border-Radius - Two Values</a> by Girl Develop It Boulder/Denver (<a href="https://codepen.io/gdiboulder">@gdiboulder</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<small><a href="https://codepen.io/gdiboulder/pen/EEQNZZ/" target="_blank">Interact with this example.</a></small>
</section>
<section>
<h3>Border-radius</h3>
<p>10px radius on top left</p>
<p>25px radius top right</p>
<p>50px radius bottom right</p>
<p>100px radius bottom left</p>
<p data-height="500" data-theme-id="32989" data-slug-hash="dmdOvJ" data-default-tab="css,result" data-user="gdiboulder" data-embed-version="2" data-pen-title="Border-radius - four values" class="codepen">See the Pen <a href="https://codepen.io/gdiboulder/pen/dmdOvJ/">Border-radius - four values</a> by Girl Develop It Boulder/Denver (<a href="https://codepen.io/gdiboulder">@gdiboulder</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<small><a href="https://codepen.io/gdiboulder/pen/dmdOvJ/" target="_blank">Interact with this example.</a></small>
</section>
<section>
<h3>Border-radius</h3>
<p>50% radius on all corners</p>
<p data-height="500" data-theme-id="32989" data-slug-hash="yKvVbN" data-default-tab="css,result" data-user="gdiboulder" data-embed-version="2" data-pen-title="Border-radius - circle" class="codepen">See the Pen <a href="https://codepen.io/gdiboulder/pen/yKvVbN/">Border-radius - circle</a> by Girl Develop It Boulder/Denver (<a href="https://codepen.io/gdiboulder">@gdiboulder</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<small><a href="https://codepen.io/gdiboulder/pen/yKvVbN/" target="_blank">Interact with this example.</a></small>
</section>
<section data-background="#f05b62">
<h1 style="color: #fafafa;">RGBA & Opacity</h1>
</section>
<section>
<h3>rgba colors & opacity</h3>
<p>In CSS, we can choose colors with hexadecimal <span style="color: #0000FF">#0000FF</span> or <span style="color: rgb(0, 0, 255)">rgb(0, 0, 255)</span></p>
<p>In CSS3, there are ways to control opacity of a color too!</p>
<ul>
<li><strong>rgba</strong> - controls the opacity of a color</li>
<li><strong>opacity</strong> - controls the opacity of an element</li>
</ul>
</section>
<section>
<h3>rgba colors & opacity</h3>
<article class="fragment">
<div style="background-color: rgb(255, 0, 0); opacity: 1; height: 50px; width: 40%; float: right; margin-bottom: 20px; border: 3px solid black;">
opacity: 1;
</div>
<div style="background-color: rgba(255, 0, 0, 1); height: 50px; width: 40%; float: left; margin-bottom: 20px;border: 3px solid black;">
rgba(255, 0, 0, 1);
</div>
</article>
<article class="fragment">
<div style="background-color: rgb(255, 0, 0); opacity: .8; height: 50px; width: 40%; float: right; margin-bottom: 20px;border: 3px solid black;">
opacity: .8;
</div>
<div style="background-color: rgba(255, 0, 0, .8); height: 50px; width: 40%; float: left; margin-bottom: 20px;border: 3px solid black;">
rgba(255, 0, 0, .8);
</div>
</article>
<article class="fragment">
<div style="background-color: rgb(255, 0, 0); opacity: .6; height: 50px; width: 40%; float: right; margin-bottom: 20px;border: 3px solid black;">
opacity: .6;
</div>
<div style="background-color: rgba(255, 0, 0, .6); height: 50px; width: 40%; float: left; margin-bottom: 20px;border: 3px solid black;">
rgba(255, 0, 0, .6);
</div>
</article>
<article class="fragment">
<div style="background-color: rgb(255, 0, 0); opacity: .4; height: 50px; width: 40%; float: right; margin-bottom: 20px;border: 3px solid black;">
opacity: .4;
</div>
<div style="background-color: rgba(255, 0, 0, .4); height: 50px; width: 40%; float: left; margin-bottom: 20px;border: 3px solid black;">
rgba(255, 0, 0, .4);
</div>
</article>
<article class="fragment">
<div style="background-color: rgb(255, 0, 0); opacity: .2; height: 50px; width: 40%; float: right; margin-bottom: 20px;border: 3px solid black;">
opacity: .2;
</div>
<div style="background-color: rgba(255, 0, 0, .2); height: 50px; width: 40%; float: left; margin-bottom: 20px;border: 3px solid black;">
rgba(255, 0, 0, .2);
</div>
</article>
<article class="fragment">
<div style="background-color: rgb(255, 0, 0); opacity: .1; height: 50px; width: 40%; float: right; margin-bottom: 20px;border: 3px solid black;">
opacity: .1;
</div>
<div style="background-color: rgba(255, 0, 0, .1); height: 50px; width: 40%; float: left; margin-bottom: 20px;border: 3px solid black;">
rgba(255, 0, 0, .1);
</div>
</article>
</section>
<section>
<h3>rgba colors</h3>
<p>controls the opacity of a color</p>
<pre><code>
.example2 {
background-color: rgba(255, 0, 0, 0.8);
}
</code></pre>
<p>color property using (red, green, blue, opacity)</p>
<p>opacity is a decimal value from 0 to 1</p>
<ul>
<li>0 - not visible</li>
<li>1 - fully visible</li>
</ul>
</section>
<section>
<h3>opacity</h3>
<p>controls the opacity of an element</p>
<pre><code>
.example2 {
opacity: 0.8;
}
</code></pre>
<p>decimal value from 0 to 1</p>
<ul>
<li>0 - not visible</li>
<li>1 - fully visible</li>
</ul>
</section>
<section>
<h3>RGBA & Opacity</h3>
<p data-height="500" data-theme-id="32989" data-slug-hash="zWpgBV" data-default-tab="css,result" data-user="gdiboulder" data-embed-version="2" data-pen-title="RGBA & Opacity" class="codepen">See the Pen <a href="https://codepen.io/gdiboulder/pen/zWpgBV/">RGBA & Opacity</a> by Girl Develop It Boulder/Denver (<a href="https://codepen.io/gdiboulder">@gdiboulder</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<small><a href="https://codepen.io/gdiboulder/pen/zWpgBV/" target="_blank">Interact with this example.</a></small>
</section>
<section>
<h3>Develop It!</h3>
<p>Change some colors to have alpha transparency or opacity.</p>
<p>Use <a href="http://hex2rgba.devoth.com/" target="_blank">http://hex2rgba.devoth.com/</a> to convert HEX to RGBA.</p>
<p>Hint: Try making the navbar 80% opaque.</p>
</section>
<section data-background="#f05b62">
<h1 style="color: #fafafa;">Text Shadow</h1>
</section>
<!--Text Shadow-->
<section>
<h2>text-shadow</h2>
<p>Add a drop shadow to a text element to make it stand out against its background.</p>
</section>
<section>
<h2>text-shadow</h2>
<p>The first value is the <b>X-coordinate</b><br/>
Second value is the <b>Y-coordinate</b><br/>
Third value is the <b>blur radius</b> <br/>
Fourth value is the <b>color of the shadow</b></p>
<p data-height="500" data-theme-id="32989" data-slug-hash="LdewRp" data-default-tab="css,result" data-user="gdiboulder" data-embed-version="2" data-pen-title="Text Shadow" class="codepen">See the Pen <a href="https://codepen.io/gdiboulder/pen/LdewRp/">Text Shadow</a> by Girl Develop It Boulder/Denver (<a href="https://codepen.io/gdiboulder">@gdiboulder</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<small><a href="https://codepen.io/gdiboulder/pen/LdewRp/" target="_blank">Interact with this example.</a></small>
</section>
<section>
<h2>Creativity with multiple shadows</h2>
<p>You can apply multiple text shadows by comma separating and also using different alpha transparencies with RGBA colors as well!</p>
<p data-height="500" data-theme-id="32989" data-slug-hash="pLaNLj" data-default-tab="css,result" data-user="gdiboulder" data-embed-version="2" data-pen-title="Text-shadow - 3D" class="codepen">See the Pen <a href="https://codepen.io/gdiboulder/pen/pLaNLj/">Text-shadow - 3D</a> by Girl Develop It Boulder/Denver (<a href="https://codepen.io/gdiboulder">@gdiboulder</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<small><a href="https://codepen.io/gdiboulder/pen/pLaNLj/" target="_blank">Interact with this example.</a></small>
</section>
<section data-background="#f05b62">
<h2 style="color: #fafafa;">Box Shadow</h2>
</section>
<section>
<h3>box-shadow</h3>
<p>Adds a drop shadow to an element</p>
</section>
<section class="example1">
<h3>box-shadow</h3>
<p>box-shadow: offset-x offset-y color</p>
<pre><code>
.example1 { box-shadow: 5px 5px red; }
</code></pre>
<div style="box-shadow: 5px 5px red; height: 100px; width: 100px; border: 2px solid black; margin: 0 auto;">
</div>
</section>
<section class="example2">
<h3>box-shadow</h3>
<p>box-shadow: offset-x offset-y blur spread color</p>
<pre><code>
.example { box-shadow: 0 0 5px 5px red; }
</code></pre>
<div style="box-shadow: 0 0 5px 5px red; height: 100px; width: 100px; border: 2px solid black; margin: 0 auto;">
</div>
</section>
<section>
<h3>box-shadow</h3>
<p>box-shadow: offset-x offset-y blur spread color</p>
<pre><code>
.example { box-shadow: 0 2px 5px 0px red; }
</code></pre>
<div style="box-shadow: 0 2px 5px 0px red; height: 100px; width: 100px; border: 2px solid black; margin: 0 auto;">
</div>
</section>
<section>
<h2>Box Shadow</h2>
<p data-height="500" data-theme-id="32989" data-slug-hash="dmJxpM" data-default-tab="html,result" data-user="gdiboulder" data-embed-version="2" data-pen-title="Box Shadow" class="codepen">See the Pen <a href="https://codepen.io/gdiboulder/pen/dmJxpM/">Box Shadow</a> by Girl Develop It Boulder/Denver (<a href="https://codepen.io/gdiboulder">@gdiboulder</a>) on <a href="https://codepen.io">CodePen</a>.</p>
<small><a href="https://codepen.io/gdiboulder/pen/dmJxpM/" target="_blank">Interact with this example.</a></small>
</section>
<section>
<h3>Develop It! </h3>
<ul>
<li>Add shadows to your text</li>
<li>Remember: Be subtle!</li>
<li>Add a box-shadow to the nav</li>
</ul>
</section>
<!-- Flow -->
<!-- Thank you! -->
<section data-background="#f05b62">
<h1 style="color: #fafafa;">Homework</h1>
</section>
<section>
<h2>Homework</h2>
<ol>
<li>Start to refine your site's design
<li>Using the new things you've learned this week try to make your site look the way you want it based on the wireframe you built on Tuesday.
</ol>
</section>
</div>
<footer>
<div class="copyright">
HTML & CSS 4wk Series <span class="red">♥</span> Boulder/Denver |
<a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/deed.en_US"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc/3.0/80x15.png" />
</a>
</div>
</footer>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.min.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
transition: 'slide', // none/fade/slide/convex/concave/zoom
// Optional reveal.js plugins
dependencies: [{
src: 'lib/js/classList.js',
condition: function() {
return !document.body.classList;
}
}, {
src: 'plugin/markdown/marked.js',
condition: function() {
return !!document.querySelector('[data-markdown]');
}
}, {
src: 'plugin/markdown/markdown.js',
condition: function() {
return !!document.querySelector('[data-markdown]');
}
}, {
src: 'plugin/highlight/highlight.js',
async: true,
condition: function() {
return !!document.querySelector('pre code');
},
callback: function() {
hljs.initHighlightingOnLoad();
}
}, {
src: 'plugin/zoom-js/zoom.js',
async: true
}, {
src: 'plugin/notes/notes.js',
async: true
}, {
src: 'plugin/accessibility-helper/js/accessibility-helper.js',
async: true,
condition: function() {
return !!document.body.classList;
}
}]
});
</script>
<script async src="//assets.codepen.io/assets/embed/ei.js"></script>
</body>
</html>