-
Notifications
You must be signed in to change notification settings - Fork 0
/
class1.html
executable file
·1161 lines (1086 loc) · 44.7 KB
/
class1.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
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
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Girl Develop It - Intro to HTML + CSS, Class 1</title>
<meta name="description" content="Girl Develop It's Intro to HTML and CSS course, customized by Cara Jo">
<meta name="author" content="Cara Jo">
<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">
<!-- For syntax highlighting -->
<!-- light editor<link rel="stylesheet" href="lib/css/light.css">-->
<!-- dark editor-->
<link rel="stylesheet" href="lib/css/light.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>
<!-- 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>Intro to HTML</h3>
<p>
<small>Session 1</small>
</p>
</section>
<!-- Welcome! -->
<section class="hide-pdf">
<h2>Welcome!</h2>
<p>Girl Develop It is here to provide affordable and accessible programs to learn software through mentorship and hands-on instruction.</p>
<p> </p>
<p class="green">Some "rules"</p>
<ul>
<li>We are here for you!</li>
<li>Every question is important</li>
<li>Help each other</li>
<li>Have fun</li>
</ul>
</section>
<!-- First Things First -->
<section class="hide-pdf">
<h2>First Things First</h2>
<p class="blue">Meet your team!</p>
<ul>
<li><b>Cara Jo:</b> Instructor & Organizer</li>
<li><b>Kathryn:</b> Instructor & Organizer</li>
<li><b>Ashlee:</b> Teaching Assistant & Organizer</li>
<li><b>Dash:</b> Teaching Assistant & Organizer</li>
<li><b>Ducke:</b> Teaching Assistant & Organizer</li>
</ul>
</section>
<section>
<h2> Meet your classmates</h2>
<p>Quickly go around the room and introduce yourself.</p>
<ul>
<li>What is your name?</li>
<li>What is your current profession</li>
</ul>
</section>
<section>
<h2>First Things First</h2>
<p> </p>
<p><strong>Format of Class</strong></p>
<p>Tuesday & Thursday each week from 6-8pm.</p>
<p>Small homework assignments on Tuesday</p>
<p>Larger homework assignments on Thursday</p>
</section>
<section>
<h2>This week</h2>
<p> </p>
<p><strong>Today</strong></p>
<p>Getting your computer setup.</p>
<p>Introduction to HTML.</p>
<p> </p>
<p><strong>Thursday</strong>
<p>Introduction to CSS<p>
</section>
<!-- Get Started -->
<section>
<h3>Get Started: Tools</h3>
<p>We'll be using the following tools in class today:</p>
<p> </p>
<ul>
<li>
<div class="orange"><strong>Browser</strong>
</div>
<ul>
<li><a href="https://www.google.com/chrome/browser/" target="_blank" class="roll"><span data-title="Chrome">Chrome</span></a>
</li>
</ul>
<br />
</li>
<li>
<div class="orange"><strong>Development Toolkit</strong>
</div>
<ul>
<li>Chrome's Inspector (built-in to Chrome)</li>
</ul>
<br />
</li>
<li>
<div class="orange"><strong>Text Editor (your preference)</strong>
</div>
<ul>
<li>Mac: <a href="https://atom.io/" target="_blank">Atom</a>, <a href="http://www.sublimetext.com/2" target="_blank" class="roll"><span data-title="SublimeText">SublimeText</span></a>, <a href="http://www.barebones.com/products/textwrangler" target="_blank" class="roll"><span data-title="TextWrangler">TextWrangler</span></a>, <a href="http://www.jedit.org/" target="_blank" class="roll"><span data-title="jEdit">jEdit</span></a>
</li>
<li>Windows: <a href="https://atom.io/" target="_blank">Atom</a>, <a href="http://www.sublimetext.com/2" target="_blank" class="roll"><span data-title="SublimeText">SublimeText</span></a>, <a href="https://notepad-plus-plus.org/download/v6.8.3.html" target="_blank" class="roll"><span data-title="Notepad++">Notepad++</span></a>
</li>
<li>Linux: <a href="https://atom.io/" target="_blank">Atom</a>, <a href="http://www.sublimetext.com/2" target="_blank" class="roll"><span data-title="SublimeText">SublimeText</span></a>, <a href="http://www.jedit.org/" target="_blank" class="roll"><span data-title="jEdit">jEdit</span></a>, <a href="https://wiki.gnome.org/Apps/Gedit#Download" target="_blank" class="roll"><span data-title="gedit">gedit</span></a>
</li>
</ul>
</li>
</ul>
<aside class="notes">Ask if everyone was able to download everything. If not, no big deal. download now.</aside>
</section>
<!-- Terms -->
<section>
<h3>Terms</h3>
<ul>
<li>
<div class="green">Web design</div>
<div>The process of planning, structuring and creating a website</div>
</li>
<li>
<div class="green">Web development</div>
<div>The process of programming dynamic web applications</div>
<ul>
<li>
<div class="orange">Front end development 👍</div>
<div>The outwardly visible elements of a website or application</div>
</li>
<li>
<div class="green">Back end development</div>
<div>The inner workings and functionality of a website or application.</div>
</li>
</ul>
</li>
</ul>
<aside class="notes">
Analogy: Architect makes blueprints (designer). Carpenter makes building (developer).
</aside>
</section>
<!-- What is HTML? -->
<section>
<h3>What is HTML?</h3>
<ul>
<li>HTML is the code that allows us to build websites</li>
<li>It adds <span class="orange">structure</span> to a webpage's content</li>
</ul>
</section>
<section>
<h3>What is HTML?</h3>
<ul>
<li>CERN scientist Tim Berners-Lee created "hypertext" to share scientific papers</li>
<li class="fragment"><span class="orange">HTML</span>: <span class="orange">H</span>yper <span class="orange">T</span>ext <span class="orange">M</span>arkup <span class="orange">L</span>anguage</li>
<li class="fragment"><span class="orange">HTTP</span>: <span class="orange">H</span>yper <span class="orange">T</span>ext <span class="orange">T</span>ransfer <span class="orange">P</span>rotocol
<br><img src="img/http.png" alt="HTTP in a URL">
</li>
<li class="fragment">First web page August 6, 1991</li>
</ul>
<aside class="notes">
Emphasize that students use hypertext every single day, it's nothing new.
</aside>
</section>
<!-- HTML in Action -->
<section>
<h3>What's a Markup Language?</h3>
<p>A markup language is a set of <span class="orange">markup tags</span>:</p>
<pre class="nowrap apache">
<code>
<tagname>content</tagname>
</code>
</pre>
<p class="fragment">Each HTML tag <span class="orange">describes</span> its content:</p>
<pre class="nowrap apache fragment">
<code>
<p>This sentence goes in a paragraph (p) tag.</p>
</code>
</pre>
<aside class="notes">Call attention to the closing slash</aside>
</section>
<section>
<h3>HTML in Action</h3>
<p>If you 'View Page Source', you see this:
<br><img src="img/homepage-html.png" alt="HTML page source">
</p>
</section>
<!-- Anatomy of a Website -->
<section>
<h3>Anatomy of a Website</h3>
<p>Your <span class="fragment grow highlight-blue">Content</span></p>
<p>+ <span class="fragment grow highlight-blue">HTML</span>: Structure</p>
<p>+ <span class="fragment grow highlight-blue">CSS</span>: Presentation</p>
<p>= <span class="fragment grow highlight-blue">Your Website</span></p>
<p>A website is a way to present your content to the world, using HTML to structure that content, and CSS to make it look good.</p>
</section>
<!-- Our Class Project -->
<section>
<h3>Our Class Project</h3>
<img src="img/design-before-after.png" alt="Design - before and after">
<aside class="notes">
This is our class project, but you can make anything you want out of it. Providing you with tools and resources to make what you want of it.
Today we will be learning how to code a site from scratch using paragraphs, headings, links, images, and lists.
Today: HTML 'playground' to get acclimated (the ugly sketching phase of web development!); Next week: CSS for styles.
Start building this project in class 3.
</aside>
</section>
<!-- Anatomy of a Website -->
<section>
<h3>Anatomy of a Website</h3>
<div class = "orange"> Concrete example</div>
<ul>
<li class ="fragment"><span class="blue">Content</span>:
<pre class="nowrap apache">
<code>
A paragraph is your content
</code>
</pre>
</li>
<li class = "fragment">
<div>+ <span class="blue">HTML</span>: Putting your content into an HTML tag to make it look like a paragraph is structure</div>
<pre class="nowrap apache">
<code>
<p>A paragraph is your content</p>
</code>
</pre>
</li>
<li class = "fragment">
<div>+ <span class="blue">CSS</span>: Making the paragraph's text red with an 18px font size is presentation</div>
</li>
<li class="fragment">
<div> = <span class="blue">Website</span>: In the browser, the paragraph looks like:</div>
<p style="color:red;font-size:20px;">A paragraph is your content</p>
</li>
</ul>
<aside class="notes">
We'll get to CSS next week. Show example of page with 'broken' CSS -- open up Inspector and remove all the CSS. Most people have seen this happen.
</aside>
</section>
<!-- Anatomy of an HTML Element -->
<section>
<h3>Anatomy of an HTML element</h3>
<ul>
<li>
<strong class="blue">Element</strong>
<ul>
<li>A full block, including opening and closing tags. An element is comprised of its content and tags.</li>
</ul>
</li>
</ul>
<pre class="nowrap apache">
<code>
<section>Content in the middle</section>
</code>
</pre>
<div class="fragment">
<ul>
<li>
<strong class="blue">Tag</strong>
<ul>
<li>Tags mark the beginning and end of an element, and indicate the element's purpose. There are opening and closing tags:</li>
</ul>
</li>
</ul>
<pre class="nowrap apache">
<code>
<p>The p tag means this content is a paragraph.</p>
</code>
</pre>
<pre class="nowrap apache">
<code>
<header>The header tag means this content is a website's header.</header>
</code>
</pre>
</div>
<aside class="notes">Think of the element as the block of code from the opening tag to closing tag, and the tag as just the container's start and finish. The tag is a component of the element, which is the huge block of code.</aside>
</section>
<!-- Tag Breakdown -->
<section>
<h3>Tag Breakdown</h3>
<img src="img/tagbreakdown.png" alt="Tag breakdown" style="border: none; box-shadow: none;" />
</section>
<!-- HTML Coding Tip -->
<section>
<h3>HTML Coding Tip #1</h3>
<p>Whenever you type an opening tag, immediately type the closing tag, then fill in your content.</p>
<ol>
<li>
<pre class="nowrap apache">
<code>
<strong>
</code>
</pre>
</li>
<li>
<pre class="nowrap apache">
<code>
<strong></strong>
</code>
</pre>
</li>
<li>
<pre class="nowrap apache">
<code>
<strong>Now I can add content!</strong>
</code>
</pre>
</li>
</ol>
<aside class="notes">Prevents any stray unclosed tags -- show an example in NotePad?</aside>
</section>
<!-- Anatomy of an HTML element -->
<section>
<h3>Anatomy of an HTML element</h3>
<p class="blue">Shorthand</p>
<ul>
<li class = "fragment">
<strong class="green">Container Element</strong>: Can contain content within the opening and closing tags:
<pre class="apache">
<code><p>This is content within the opening and closing tags.</p></code>
</pre>
</li>
<li class = "fragment">
<strong class="green">Stand-Alone Element</strong>: When an element does not contain any content within its opening and closing tags, use the <span class="orange"><tagname /></span> shorthand:
<pre class="nowrap apache">
<code><br /></code>
</pre>
<pre class="nowrap apache">
<code><img src="images/photo.jpg" /></code>
</pre>
<small>The examples are shorthand for <em><br></br></em> and <em><img src="images/photo.jpg"></img></em></small>
</li>
</ul>
</section>
<section>
<h3>Anatomy of an HTML element</h3>
<p class="blue">Attributes</p>
<p>Adding <span class="orange">attributes</span> to an HTML tag provides additional information about the HTML element</p>
<img src="img/html-tag.gif" alt="Attributes in HTML" />
<aside class="notes">Skip to next slide! Has more info</aside>
</section>
<section>
<h3>Anatomy of an HTML element</h3>
<p class="blue">Attributes</p>
<img src="img/html-tag.gif" style="max-height:130px;" alt="Attributes in HTML" />
<ul>
<li class = "fragment">
<strong class="orange">Attribute Name</strong>: class, ID, style, href, etc.
<ul>
<li>Placed inside an opening tag, before the right angle bracket.</li>
</ul>
</li>
<li class="fragment">
<strong class="orange">Attribute Value</strong>
<ul>
<li>Value is the value assigned to a given attribute</li>
<li>Values must be contained inside quotation marks:
<pre>
<code class="apache"><img src="my_picture.jpg" />
<div id="intro">Lorem ipsum</div>
<a href="http://girldevelopit.com" class="fancy-link">GDI</a></code>
</pre>
</li>
</ul>
</li>
</ul>
<aside class="notes">
Attribute placed inside an opening tag, right before the angle bracket. Can add as many as you want and order doesn't matter. Code an example of an image with multiple attributes (src, ID, class, alt, title). Each attribute separated by a space with name="value".
</aside>
</section>
<!-- Fundamental Structure of an HTML File -->
<section>
<h3>The Fundamental Structure of an HTML File</h3>
<p class="blue">Doctype</p>
<p>The first thing in an HTML file is the doctype, which tells the browser which language the page is using:</p>
<pre class="apache nowrap">
<code>
<!DOCTYPE html>
</code>
</pre>
<img src="img/document-types.jpg" alt="Various document types" />
<p><small>The doctype is case-insensitive. <br/>DOCtype, doctype, DocType and DoCtYpe are all valid.</small></p>
<aside class="notes">
Exclamation mark indicates informative content that doesn't show up as text on the screen. Example: A human can look at a type of document and understand what type of document that is (letter, award, outline, etc.), but a browser has to be told specifically what it's looking at. Reads from top to bottom -- now that it knows it's HTML, it moves on to parsing the rest of the document as HTML.
</aside>
</section>
<section>
<h3>The Fundamental Structure of an HTML File</h3>
<p class="blue">HTML Element</p>
<p>After <!DOCTYPE html>, the page content must be
contained between <html></html> tags.</p>
<pre class="apache"><code>
<!DOCTYPE html>
<html>
</html>
</code></pre>
</section>
<section>
<h3>The Fundamental Structure of an HTML File</h3>
<p class="blue">Head Element</p>
<p>The head contains information about the page, but <u>does not contain page content</u>. It contains elements that let the browser know:</p>
<ul class="left-align" style="font-size:90%;margin-left:3em">
<li>The page's <span class="orange">title</span></li>
<li><span class="orange">Meta information</span> about the page: Meta information is not visible to the user, but has many purposes, one of which is to tell search engines about your page, who created it, and the page's description</li>
<li>Where to find the <span class="orange">CSS file</span> (which styles the page)</li>
</ul>
<pre class="apache"><code><!DOCTYPE html>
<html>
<head>
</head>
</html></code></pre>
<aside class="notes">We'll get into the CSS file part next week</aside>
</section>
<section>
<h3>The Fundamental Structure of an HTML File</h3>
<p class="blue">Body Element</p>
<p>The body contains the actual content of the page. Everything that is contained in the body is visible to the user.</p>
<small class="fragment green">Most of your work will be done within the <body></body> tags!</small>
<pre class="apache"><code>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>
</code></pre>
</section>
<!-- Head and Body Tags: Example -->
<section>
<h3>Head and Body Tags: Example</h3>
<img src="img/example-headbody.png" alt="example of head and body" style="box-shadow:none;"/>
<aside class="notes">Make a quick example on your machine, showing some head tags (title, possibly meta description), and some body tags as you update.</aside>
</section>
<!-- The Fundamental Structure of an HTML File -->
<section>
<h3>The Fundamental Structure of an HTML File</h3>
<p>Memorize this ☺</p>
<pre class="apache"><code><!DOCTYPE html>
<html>
<head>
<title>Title of the page</title>
</head>
<body>
All of your page content goes here
</body>
</html></code></pre>
<aside class="notes">Memorize this, and you will go far! Every page begins with this.</aside>
</section>
<section>
<h3>Get Started: Folder Structure</h3>
<p>All the files for your site should be stored within the same folder.</p>
<div class="left" style="width: 45%;">
<p class="left-align"><strong>This includes:</strong>
</p>
<ul>
<li>HTML Files</li>
<li>CSS Files</li>
<li>Images</li>
<li>Script files</li>
<li>Anything else that will appear on your site</li>
</ul>
<p class="left-align"><small>Note: File names should not include spaces or special characters. File names ARE case sensitive.</small>
</p>
</div>
<div class="right" style="width: 45%;">
<img src="img/folderstructure1.png" alt="Folder Structure">
</div>
<aside class="notes">
If confused by file system, don't worry, can still get through class by starting from scratch.
</aside>
</section>
<section>
<h3>Get Started: Folder Structure</h3>
<div class="left" style="width: 45%;">
<p class="left-align">Go ahead and create your folders
<br /> </p>
<p class="left-align">Ignore the HTML and CSS files for now</p>
</div>
<div class="right" style="width: 45%;">
<img src="img/folderstructure1.png" alt="Folder Structure">
</div>
<aside class="notes">
Mac, PC, Linux -- doesn't matter. As long as the structure is the same and you choose a folder you'll have access to next week. MAKE FOLDERS IN FRONT OF STUDENTS.
</aside>
</section>
<!-- Let's Develop It! -->
<section class="hide-pdf">
<h2>Let's develop it!</h2>
<ol>
<li>Open your text editor and create a new file.</li>
<li>Save it as index.html in the 'class1' folder you created earlier.</li>
<li>Add the fundamental structure (a doctype, head, title and body).</li>
</ol>
<img src="img/folderstructure1.png" alt="Folder Structure">
<p>Later we'll add some content to it!</p>
<aside class="notes">
Code this alongside students from scratch. Have them open up index.html both in Chrome and in a text editor, tell them to refresh every time you add text to their text editor.
</aside>
</section>
<!-- Nesting-->
<section>
<h3>Nesting</h3>
<div class="left" style="width:50%">
<p>All elements "nest" inside one another</p>
<p><small>Nesting is what happens when you put other containing tags inside other containing tags. For example, you would put the <p></p> inside of the <body></body> tags. The <p></p> is now nested inside the <body></body>, and is one of its descendants</small></p>
</div>
<div class = "left" style = "width:50%">
<img src = "img/nesting.jpg"/>
</div>
<aside class="notes">
Do this example in a text editor.
</aside>
</section>
<section>
<h3>Nesting: Example</h3>
<div>
<p>All your page's content is 'nested' inside the body element:</p>
<pre><code class="html"><body>
<p>
A paragraph inside the body element
</p>
</body></code></pre>
</div>
<div class="fragment">
<p><br />And other elements can be nested inside of that:</p>
<pre><code class="apache"><body>
<p>
A paragraph inside the body element
<em>which has some italic text</em>
and
<strong>some bold text</strong>
</p>
</body></code></pre>
</div>
<div class="fragment">
<p class="left-align">⇒ A paragraph inside the body element <em>which has some italic text</em> and <strong>some bold text</strong></p>
</div>
</section>
<section>
<h3>Nesting</h3>
<p>HTML elements are often looked at as a family tree. Developers will often refer to elements as "siblings", "immediate children", and "descendants".</p>
<p class="green">Can you name any siblings?</p>
<pre class="apache"><code><!DOCTYPE html>
<html>
<head>
<title>Title of the page</title>
</head>
<body>
All of your page content goes here
</body>
</html></code></pre>
<p class="green fragment">How about immediate children?</p>
<aside class="notes">Hint: There is one pair of siblings, so two siblings total. HTML tag called the 'root' element, parent of all parents.</aside>
</section>
<!-- HTML Coding Tip -->
<section>
<h3>HTML Coding Tip #2</h3>
<ol>
<li>Whenever you add a 'child' element:
<pre><code class="html"><ul>
</ul></code></pre> <p> </p>
</li>
<li>... indent it on a new line!
<pre><code class="html"><ul>
<li>I'm indented!</li>
<li>I'm also indented!</li>
</ul></code></pre>
</li>
</ol>
<p><br />This will make your life much easier down the road, as you add more content and style your pages.</p>
<aside class="notes">Helps you more obviously see the family relationships and troubleshoot problems.</aside>
</section>
<section>
<h3>HTML Coding Tip #3</h3>
<p>HTML ignores multiple whitespaces in a row. You can add consecutive white space characters (spaces, tabs, & carriage returns) into your HTML, but when you view that page — <em>all but one disappears!</em></p>
<p> </p>
<div>
<div class = "left" style = "width:50%">
<p><span class="orange"><u>HTML:</u></span></p>
<pre class="html"><code>
<p>Two carriage returns
Three carriage returns
Plus multiple spaces ...</p>
</code></pre>
</div>
<p><span class="orange"><u>Result:</u></span></p>
<div>
<p style="font-size:90%;">Two carriage returns
Three carriage returns
Plus multiple spaces ...</p>
</div>
<div class ="clear"></div>
</div>
<p></p>
<p><small>To force consecutive spaces to show, use <em>&nbsp;</em> (stands for <em>"no-break space"</em>) in your HTML instead of spaces.</small></p>
<aside class="notes">
This is very different from a word processor. You can use that to your advantage, for organizational purposes.
</aside>
</section>
<!-- Common HTML Elements -->
<section>
<h3>Common HTML Elements</h3>
<p class="blue">Paragraph</p>
<div>
<div class = "left" style = "width:50%">
<p><span class="orange"><u>HTML:</u></span></p>
<pre><code><p>Paragraph 1</p>
<p>Paragraph 2</p>
<p>Paragraph 3</p></code></pre>
<small><br />White space outside of any tags won't render (that's just for us humans!):<p><br /></p></small>
<pre><code>
<p>Paragraph 1</p>
<p>Paragraph 2</p>
<p>Paragraph 3</p>
</code></pre>
</div>
<p><span class="orange"><u>Result:</u></span></p>
<div>
<p>Paragraph 1</p>
<p>Paragraph 2</p>
<p>Paragraph 3</p>
</div>
<div class ="clear"></div>
</div>
</section>
<section>
<h3>Common HTML Elements</h3>
<p class="blue">Paragraphs in Action</h3>
<p>Paragraphs allow you to format your content in a readable fashion.</p>
<img src="img/example-paragraphs.png" alt="Example of Paragraphs in the wild" />
<p><small>You can edit how paragraphs are displayed with CSS</small></p>
</section>
<section>
<h3>Common HTML Elements</h3>
<p class="blue">Headings</p>
<div>
<div class = "left" style = "width:50%">
<p><span class="orange"><u>HTML:</u></span></p>
<pre><code><h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6></code></pre>
</div>
<div class = "left" style = "width:50%">
<p><span class="orange"><u>Result:</u></span></p>
<h1 style = "font-size: 120%">Heading 1</h1>
<h2 style = "font-size: 110%">Heading 2</h2>
<h3 style = "font-size: 105%">Heading 3</h3>
<h4 style = "font-size: 95%">Heading 4</h4>
<h5 style = "font-size: 85%">Heading 5</h5>
<h6 style = "font-size: 75%">Heading 6</h6>
</div>
<div class ="clear"></div>
</div>
<hr />
<small>Heading number indicates hierarchy, not size. Think: Outlines from high school papers</small>
</section>
<section>
<h3>Common HTML Elements</h3>
<p class="blue">Headings in Action</p>
<img src="img/example-headings.png" alt="Example of headings" style="max-height:17em;" />
</section>
<section>
<h3>Common HTML Elements</h3>
<p class="blue">Formatted text</p>
<div>
<div class = "left" style = "width:70%">
<p><span class="orange"><u>HTML:</u></span></p>
<pre class="apache">
<code><p>Here is a paragraph with <em>Emphasized</em> text and <strong>Important</strong> text.</p></code></pre>
</div>
<div class = "left" style = "width:30%">
<p><span class="orange"><u>Result:</u></span></p>
<p>Here is a paragraph with <em>Emphasized</em> text and <strong>Important</strong> text.</p>
</div>
</div>
<div class ="clear"></div>
<hr />
<small>Note: <em>em</em> and <em>strong</em> are meant to indicate meaning through style. If you want italicized or bold text for appearance and not to communicate meaning, you should use CSS.</small>
</section>
<!-- Let's Develop It! -->
<section class="hide-pdf">
<h2>Let's Develop It!</h2>
<p class="left-align">Let's add some content to our site!</p>
<ol>
<li>Add one of each level of heading with 1-2 short paragraphs of text below each heading.</li>
<li>Italicize and bold some text within a few paragraphs.</li>
</ol>
<p> </p>
<small class="blue">Remember to place content in the <em>body</em> element, not the <em>head</em></small>
</section>
<!-- Common HTML Elements -->
<section>
<h3>Common HTML Elements</h3>
<p class="blue">Links</p>
<p>Standard links have three components:</p>
<ol>
<li>The <span class="green">tag:</span>
<p style="text-indent:2em;"><em><a></a></em></p>
</li>
<li>The <span class="green">content</span> (the clickable portion within the <em>a</em> element):
<p style="text-indent:2em;"><em>GDI Boulder/Denver</em></p>
</li>
<li>The <span class="green">href</span> attribute (the destination of the link):
<p style="text-indent:2em;"><em>href="http://www.girldevelopit.com/chapters/boulder"</em></p>
</li>
</ol>
<p><pre class="apache"><code><a href="http://www.girldevelopit.com/chapters/boulder">GDI Boulder/Denver</a></code></pre></p>
</section>
<section>
<h3>Common HTML Elements</h3>
<p class="blue">Additional Link Options</p>
<ol>
<li>The <span class="green">title</span> attribute for descriptive 'hover' text:
<p style="text-indent:2em;"><em>title="Read more about GDI Boulder/Denver"</em></p>
</li>
<li>The <span class="green">target</span> attribute:
<p style="text-indent:2em;"><em>target="_blank"</em> (opens link in a new tab)</p>
</li>
</ol>
<p><pre class="apache"><code><a href="http://www.girldevelopit.com/chapters/boulder" title="Read more about GDI Boulder/Denver" target="_blank">GDI Boulder</a></code></pre></p>
<aside class="notes">The "title" is mainly for accessibility. Provides additional description when link hovered over. If there's time, show example of hover text.</aside>
</section>
<section>
<h3>Common HTML Elements</h3>
<p class="blue">Additional Link Options</p>
<ol start="3">
<li><span class="green">Surround another element</span>, such as a heading or images, within <a></a> tags to link it<p> </p></li>
</ol>
<div>
<div class = "left" style = "width:85%">
<p><span class="orange"><u>HTML:</u></span></p>
<pre>
<code class="apache"><a href="http://petsmart.com">
<img src="" />
</a></code></pre>
</div>
<div class = "left" style = "width:15%">
<p><span class="orange"><u>Result:</u></span></p>
<a href="http://petsmart.com">
<img style="box-shadow:none;margin:0;border:none;" src="" />
</a>
</div>
<aside class="notes">Mention that we'll get to images very soon.</aside>
</div>
<div class ="clear"></div>
</section>
<section>
<h3>Common HTML Elements</h3>
<p class="blue">Additional Link Options</p>
<ol start="4">
<li><span class="green">Make an email link</span>, which launches a user's mail program, by inserting <span class="orange"><strong>mailto:</strong></span> directly before the email address<br />
<pre><code class="apache"><a href="mailto:[email protected]">Email me!</a></code></pre>
</li>
</ol>
</section>
<!-- Let's Develop It! -->
<section class="hide-pdf">
<h2>Let's Develop It</h2>
<p>Let's add links to our site!</p>
<p> </p>
<p>Add links that:</p>
<ol>
<li>Open in the same tab/window</li>
<li>Open in a new tab/window</li>
<li>Link to an e-mail address</li>
</ol>
</section>
<!-- Common HTML Elements -->
<section>
<h3>Common HTML Elements</h3>
<p class="blue">Images</p>
<p>Images have three components:</p>
<ol>
<li>The <span class="green">tag:</span>
<p style="text-indent:2em;"><em><img /></em></p>
</li>
<li>The <span class="green">src</span> attribute:
<p style="text-indent:2em;"><em>src=""</em></p>
</li>
<li>The <span class="green">alt</span> attribute:
<p style="text-indent:2em;"><em>alt="Picture of a city"</em></p>
</li>
</ol>
</section>
<section>
<h3>Common HTML Elements</h3>
<p class="blue">Images</p>
<pre class="apache"><code><img src="img/photo-city.png" alt="Picture of a city" /></code></pre>
<p><img src="img/photo-city.png" alt="Picture of a city" style="box-shadow:none;border-radius:0;width: 600px;"/></p>
<p><small>* Notice: This tag is our first example of a stand-alone or "self-closing" element.</small></p>
</section>
<!-- File Paths -->
<section>
<h3>File Paths</h3>
<p class="blue">Relative vs. absolute paths for links, images, etc.</p>
<ul>
<li>
<strong class="green">Relative</strong>
<ul>
<li>Relative paths change depending upon the page the link is on.
<ul>
<li><small>Links within the same directory need no path information. <code class="green">"filename.jpg"</code></small></li>
<li><small>Subdirectories are listed without preceding slashes. <code class="green">"images/filename.jpg"</code></small></li>
</ul>
</li>
</ul>
</li>
<li>
<strong class="green">Absolute</strong>
<ul>
<li>Absolute paths refer to a specific location of a file, including the domain. <small><code class="green">"http://www.girldevelopit.com/chapters/boulder"</code></small></li>
<li>Typically used when pointing to a link that is not within your own domain.</li>
</ul>
</li>
</ul>
<aside class="notes">Analogy: Relative paths are like directions, absolute are like a specific address.
Show example: Save an image from somewhere, then reference it in a text editor.</aside>
</section>
<!-- Common HTML Elements -->
<section>
<h3>Common HTML Elements</h3>
<p class="blue">Line Break</p>
<div>
<div class = "left" style = "width:55%;font-size:85%">
<pre class="apache">
<code><p>
You spin me right round, baby<br />
Right round like a record, baby<br />
Right round round round
</p></code></pre>
</div>
<div class = "left left-align" style = "font-size:60%;width:35%">
<p>You spin me right round, baby<br />Right round like a record, baby<br/>Right round round round</p>
</div>
<div class ="clear"></div>
<br/>
<br/>
</div>
</section>
<!-- Let's Develop It! -->
<section class="hide-pdf">
<h2>Let's Develop It!</h2>
<p>Let's add some images and line breaks to our page. We can even turn some images into links!</p>
</section>
<!-- Common HTML Elements -->
<section>
<h3>Common HTML Elements</h3>
<p class="blue">Unordered and ordered lists</p>
<div>
<div class = "left" style = "width:50%">
<p><span class="orange"><u>HTML:</u></span></p>
<pre class="apache">
<code><ul>
<li>Unordered List Item</li>
<li>Another List Item</li>
</ul>
<ol>
<li>Ordered List Item</li>
<li>Another List Item</li>
</ol></code>
</pre>
</div>
<div class = "left" style = "width:50%">
<p><span class="orange"><u>Result:</u></span></p>
<ul style="margin-bottom:1em;">
<li>Unordered List Item</li>
<li>Another List Item</li>
</ul>
<ol>
<li>Ordered List Item</li>
<li>Another List Item</li>
</ol>
</div>
</div>
<hr />
<small>Unordered lists (ul) are bulleted by default, while ordered lists (ol) are numbered by default.</small>
</section>
<section>
<h3>Common HTML Elements</h3>
<p class="blue">Lists in Action</p>
<p>Lists can be used to organize any list of items.</p>
<img src="img/example-lists.png" alt="Examples of lists" style="max-height:13.5em;" />
<p><small>You'd be surprised how often lists are used in web development.</small></p>
</section>
<!-- Let's Develop It! -->
<section class="hide-pdf">
<h2>Let's Develop it!</h2>
<p>Let's add one of each ordered and unordered lists to our page.</p>
<p>We can make a list of links or even a list of images!</p>
</section>
<section>
<h3>Common HTML Elements</h3>
<p class="blue">Comments</p>
<p>You can add comments to your code that will not be seen by the browser, but only visible when viewing the page source.</p>
<pre class="html"><code><!-- Comment goes here --></code></pre>
<p> </p>
<p><small>Comments can be used to organize your code into sections so you (or someone else) can easily understand your code. It can also be used to 'comment out' large chunks of code to hide it from the browser.</small><br /></p>
<pre class="html">
<code><!-- Beginning of header -->
<div id="header">
Header Content
</div>
<!-- End of header -->
<!--<ol>
<li>List Item</li>
<li>Another List Item</li>
</ol>--> </code></pre>
<aside class="notes">
Commenting makes you a good person!