-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhtml.html
More file actions
529 lines (464 loc) · 17.3 KB
/
html.html
File metadata and controls
529 lines (464 loc) · 17.3 KB
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
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Writing HTML Lesson</title>
<!-- =============================================
Adapted and modified content from GU Yiling:
http://justineo.github.io/slideshows/writing-css/
==============================================-->
<meta name="description" content="A brief introduction of CSS.">
<meta name="author" content="GU Yiling, modified by Chris Lindgren">
<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/style.css">
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/font-awesome.css">
<link rel="stylesheet" href="css/just.css" id="theme">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="css/zenburn.css">
<style>
var::before {
content: "[";
}
var::after {
content: "]";
}
var::before,
var::after {
color: #666;
font-style: normal;
}
iframe {
box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}
span.type::before {
content: "‘<";
}
span.type::after {
content: ">’";
}
</style>
<!-- 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 = "../../reveal.js/css/print/pdf.css";
document.getElementsByTagName("head")[0].appendChild(link);
}
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h1>
Writing <abbr title="HyperText Markup Language">HTML</abbr>
</h1>
<small>Some content used from Duckett (2011).</small>
</section>
<!-- TOC -->
<section>
<h2>In this demo-lecture:</h2>
<style>
#overview-list li {
list-style-type: none;
}
#overview-list .fa {
display: inline-block;
width: 40px;
}
</style>
<ul id="overview-list">
<li><span class="fa fa-check"></span> General knowledge</li>
<li><span class="fa fa-check"></span> Basic HTML Tags</li>
<li><span class="fa fa-check"></span> Block vs. Inline Elements</li>
</ul>
</section>
<!-- WHAT'S HTML? -->
<section>
<!-- HTML acronym -->
<section>
<h2>What is HTML?</h2>
<p class="fragment"><b>H</b>yper <b>T</b>ext <b>M</b>arkup <b>L</b>anguage</p>
<p class="fragment">
Tags == declarative "commands" for browsers
</p>
</section>
<!-- Anatomy of website -->
<section>
<h3>Anatomy of a Typical Website</h3>
<ul>
<li class="fragment">
<b>Content</b>: Text, Media
</li>
<li class="fragment">
+ <b>HTML</b>: Structure + Semantics
</li>
<li class="fragment">
+ <b>CSS</b>: Presentation + Design
</li>
<li class="fragment">
+ <b>JS</b>: Interactivity
</li>
<li class="fragment">
= <b>Your Website</b>
</li>
</ul>
</section>
<!-- .html file -->
<section>
<h3>.html files</h3>
<ul>
<li class="fragment">
A "marked up" text-file with tags
</li>
<li class="fragment">
HTML considered a "declarative" language
</li>
<li class="fragment">
Saved with <code>.html</code> extension
</li>
<li class="fragment">
Standardized language of web browsers
</li>
<li class="fragment">
HTML defines semantics for "chunks" of information to increase its <a
href="http://www.website-accessibility.com/web-accessibility/web-accessibility-basics/how-disabled-use-web.html">Accessibility</a>
</li>
</ul>
</section>
<!-- Create project folder -->
<section>
<h3>Let's create a practice project folder and .html file</h3>
<ol>
<li class="fragment">
In Desktop, select "Create a new repository" and create a <code>4814-html-practice</code> folder in your typical local folder
</li>
<li class="fragment">
Once created, use Desktop to open the repo in VSC
</li>
<li class="fragment">
In VSC, create an <code>index.html</code> file in the root folder
</li>
<li class="fragment">
Open the <code>index.html</code> file and check your default indentation rule
</li>
<li class="fragment">
In GH, let's create and publish a gh-pages branch to your profile
</li>
</ol>
</section>
<!-- Anatomy of web page -->
<section>
<h3>Basic Anatomy of an HTML Web Page</h3>
<pre><code class="html"><!doctype html>
<html>
<head>
<title>Title of page here</title>
<meta description="Metadata and resources go in the head." />
</head>
<body>
<h1>Rendered page content here.</h1>
</body>
</html>
</code></pre>
</section>
<!-- Anatomy of web page diagram -->
<section>
<h3>Basic Anatomy of an HTML Web Page</h3>
<figure>
<img src="img/james-html-head-body-summary.png"
alt="Diagram indicating how a web page is comprised of a head and body element.
The head contains metadata and resources, while the body contains user content."
width="500vw" />
<figcaption>
<a href="https://www.internetingishard.com/html-and-css/basic-web-pages/#structure-of-a-web-page" target="_blank" rel="noopenner">James' diagram</a> of the basic elements of a web page.
</figcaption>
</figure>
</section>
<!-- Anatomy of tag diagram -->
<section>
<h3>
Basic Anatomy of an HTML tag
</h3>
<img src="img/duckett-p-tag-anatomy.jpg"
alt="Diagram indicating how 2 tags are required to create an element and its syntax."
width="850vw" />
<figcaption>
Duckett's diagram of the basic tag syntax.
</figcaption>
</section>
<!-- Tag attributes 1 -->
<section>
<h3>
What are attributes?
</h3>
<ul>
<li class="fragment">
Within each "opening tag" <code><tag></code>, you can include attributes.
</li>
<li class="fragment">
Some attributes can be used in all elements: <code>id</code> and <code>class</code>
<ul>
<li><code>id</code>: unique identifier for an element; 1 per page</li>
<li><code>class</code>: identifier for a class of shared styled elements; helps select many across site pages</li>
</ul>
</li>
<li class="fragment">
Other attributes are specific to specific elements: <code>href</code> for <code>a</code> or <code>link</code>
</li>
<li class="fragment">
MDN's list of <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes" target="_blank" rel="noopenner">attributes</a>
</li>
</ul>
</section>
<!-- Tag attributes 1 -->
<section>
<h3>
Example tags with attributes
</h3>
<pre><code class="html"><tagname attribute="value">
content
</tagname>
<html lang="en">scope == the entire page</html>
<span lang="en">scope == wrapped inline text</span>
<span lang="fr">portée == texte en ligne encapsulé</span>
<a href="http://www.google.com" target="_blank" rel="noopenner">
Google
</a>
<section id="about" class="f-didot">
<h2>About Me</h2>
</section>
</code></pre>
</section>
<!-- Codepen resources -->
<section>
<h3>Interactive anatomy of an HTML tag</h3>
<img src="img/html-anatomy.png" alt="Screenshot of Codepen of basic HTML tag anatomy." />
<p>
<a href="https://codepen.io/lndgrn/full/PmMPog/" target="_blank">Link to Codepen</a>
</p>
</section>
<!-- DOCTYPE -->
<section>
<h4>DocType + <code><html></code></h4>
<figure>
<pre><code class="html"><!doctype html>
<html lang="en">
</html>
</code></pre>
</figure>
<ul>
<li>
<code>doctype</code>:
<ol>
<li>
tells the browser what type of HTML specification you are writing (<a
href="https://en.wikipedia.org/wiki/Document_type_declaration" target="_blank">Wikipedia article on
<code>doctype</code></a>).
</li>
<li>
needs to be at start at every HTML page to tell browser which version of HTML you're using (HTML5
here).
</li>
<li>
is not the <code>html</code> tag.
</li>
</ol>
</li>
<li>
<code>html</code>: the root of the page.
</li>
<li class="fragment">
☞ Add these tags to your index.html file.
</li>
</ul>
</section>
<!-- HEAD -->
<section>
<h4><code><head></code> element</h4>
<figure>
<pre><code class="html"><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<!-- declaration that maintains user zooming -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My Practice Site</title>
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="assets/css/style.css">
</head>
</html>
</code></pre>
</figure>
<ul>
<li>
Contains 2 main tags:
<ol>
<li class="fragment">
<strong>"Meta"data</strong>: Info about the page (<a href="https://github.com/kevinSuttle/html-meta-tags"
target="_blank" rel="noopenner">comprehensive list</a>). <br />Note how <code><meta /></code> tags self-close.
</li>
<li class="fragment">
<strong>Resources</strong>: For example, <code><link></code> tags that tell the browser WHERE to locate CSS
stylesheets.
</li>
</ol>
</ul>
</section>
<!-- BODY -->
<section>
<h4><code><body></code> Element</h4>
<ul>
<li>
The body contains the actual content of the page.</li>
<li class="fragment">
☞ Add the body to your page with an utterance.
</li>
</ul>
<figure>
<pre><code class="html"><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<!-- declaration that maintains user zooming -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My Practice Site</title>
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="assets/css/style.css">
</head>
<body>
Content goes in here.
</body>
</html>
</code></pre>
</figure>
</section>
<!-- Visual BODY example -->
<!-- <section>
<h4>A visual example of what could be written in the <code><body></code></h4>
<img src="img/page-structure.gif" alt="Visual example of a structured HTML document." />
</section> -->
</section>
<section>
<h2><code>/* questions? */</code></h2>
</section>
<!-- HTML ELEMENT BASICS -->
<section>
<section>
<h2>The Basics of <code><body></code> Tags</h2>
</section>
<!-- BLOCK vs. INLINE 1 -->
<section>
<h3>Inline vs. Block Elements #1</h3>
<img src="img/duckett-blocks-p361.png"
alt="Image from Duckett demonstrating difference between inline and block elements." />
</section>
<!-- BLOCK vs. INLINE 2 -->
<section>
<h3>Inline vs. Block Elements #2</h3>
<ul>
<li>
<code>Block</code> elements act like "building blocks," so they start on new line in the document.
</li>
<li class="fragment">
<code>block</code> elements can be nested to create parent-child relationships.
</li>
<li class="fragment">
Most elements actually are <code>block</code> elements.
</li>
<li class="fragment">
<code>Inline</code> elements can begin within a line and do not by default start a new line.
</li>
<li class="fragment">
An <code>inline</code> element's width only extends as far as it is defined by its tags.
</li>
<li class="fragment">
With CSS, you can control the spacing between both block and inline elements: borders, margins, padding, and background
colors.
</li>
</ul>
</section>
<!-- BvsI Visual -->
<section>
<h3>Block vs. Inline Contexts (James)</h3>
<figure>
<img src="img/james-inline-vs-block-elements.png"
alt="Diagram indicating how block elements start on a new line,
while inline elements do not."
width="560vw" />
<figcaption>
<a href="https://www.internetingishard.com/html-and-css/basic-web-pages/#emphasis-italic-elements" target="_blank" rel="noopenner">James' diagram</a> of the basic elements of a web page.</figcaption>
</figure>
</section>
<!-- HTML5 Example -->
<section>
<h3>Example Nested HTML5 Block Elements</h3>
<img src="img/html5-structure.gif"
alt="Visualized nesting of HTML5 elements within content areas"
width="500vw"
/>
</section>
<section>
<h3>Practice Writing <code><html></code></h3>
<p style="text-align: left;">
Let's practice writing and structuring some more HTML elements!
</p>
<p style="text-align: left;">
Write 2 examples of a meaningful set of parent-child nested relationships.
</p>
</section>
</section>
<!-- Homework -->
<section>
<h2>Homework</h2>
<ul>
<li>
Complete the module readings for Week 3, Day 1
</li>
<li>
Complete the next exercise: <code>2-html-fave-things</code>
</li>
<li>
Let's review the <a href="https://github.com/engl-4814/html-exercises/tree/gh-pages/2-fave-things" target="_blank" rel="noopenner">README</a>
</li>
</ul>
</section>
</section>
</div>
</div>
<script src="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,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || "linear", // default/cube/page/concave/zoom/linear/fade/none
// Parallax scrolling
// parallaxBackgroundImage: "https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg",
// parallaxBackgroundSize: "2100px 900px",
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: "js/classList.js", condition: function () { return !document.body.classList; } },
{ src: "js/marked.js", condition: function () { return !!document.querySelector("[data-markdown]"); } },
{ src: "js/markdown.js", condition: function () { return !!document.querySelector("[data-markdown]"); } },
{ src: "js/highlight.js", async: true, callback: function () { hljs.initHighlightingOnLoad(); } },
{ src: "js/zoom.js", async: true, condition: function () { return !!document.body.classList; } },
{ src: "js/notes.js", async: true, condition: function () { return !!document.body.classList; } }
]
});
</script>
<script async src="http://assets.codepen.io/assets/embed/ei.js"></script>
</body>
</html>