-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
1673 lines (1525 loc) · 55.1 KB
/
index.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>Intro to HTML5 & CSS3</title>
<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
<meta name="author" content="Hakim El Hattab">
<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="reveal/css/reveal.css">
<link rel="stylesheet" href="reveal/css/theme/default.css" id="theme">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="reveal/lib/css/zenburn.css">
<!-- For the slides -->
<link rel="stylesheet" href="css/slides.css">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
document.write( '<link rel="stylesheet" href="reveal/css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
</script>
<script src="js/jquery-1.8.2.min.js"></script>
<script src="js/slides.js"></script>
<!--[if lt IE 9]>
<script src="reveal/lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="gdi"><p>pittsburgh</p></div>
<div class="reveal">
<!-- Used to fade in a background when a specific slide state is reached -->
<div class="state-background"></div>
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section data-state="activity">
<p>
<h3>Download Class Materials</h3>
<a class="download-link" href="http://bit.ly/gdipgh-html5-materials">http://bit.ly/gdipgh-html5-materials</a>
</p>
<p>
<h3>View Class Slides</h3>
<a class="download-link" href="http://bit.ly/gdipgh-html5">http://bit.ly/gdipgh-html5</a>
</p>
</section>
<section>
<h1>Intro to HTML5 & CSS3</h1>
<h4>Julie Pagano</h4>
</section>
<section data-state="activity">
<h2>Introductions</h2>
<img src="images/intro.png" alt="introduction">
</section>
<section data-state="activity">
<h2>Please Ask Questions!</h2>
<img src="images/question.png" alt="questions">
</section>
<section>
<h2>Goals for the Workshop</h2>
<p>
<ul>
<li>Intro to HTML5</li>
<li>Intro to CSS3</li>
<li>How to use them to build awesome web sites</li>
</ul>
</p>
</section>
<section>
<h2>Disclaimer</h2>
<p>There is a lot to cover for these technologies.
This workshop is just an introduction.</p>
</section>
<section data-state="activity">
<section>
<h2>Activity: Enhance a web site using HTML5 & CSS3</h2>
<p>Enhance our
<a href="activity/women-in-computing/index.html">Women in Computing</a>
web site to use HTML5 & CSS3</p>
</section>
<section>
<h2>You will need</h2>
<ul>
<li>Files for the activity (included in <a href="http://bit.ly/gdipgh-html5-materials">class materials</a>)</li>
<li>A modern browser (we recommend
<a href="https://www.google.com/intl/en/chrome/browser/">Chrome</a>)</li>
<li>A text editor (we recommend <a href="http://www.sublimetext.com/">Sublime Text</a>)</li>
</ul>
</section>
<section>
<h2>Open the project in your text editor</h2>
<p>The project folder is:</p>
<p>
<code>intro-to-html5-and-css3/activity/women-in-computing</code>
</p>
<img src="images/screenshots/activity-subl.png" />
</section>
<section>
<h2>Open the project in your browser</h2>
<p>
If you're viewing the slides locally, it is
<a href="activity/women-in-computing/index.html">here</a>
</p>
<img src="images/screenshots/activity-browser.png" />
</section>
</section>
<section>
<h2>World Wide Web Consortium</h2>
<img src="images/W3C_Icon.svg">
<p>Main international standards organization for the web</p>
</section>
<section>
<h2>HTML5 Specifications</h2>
<ul>
<li>2004 - started work</li>
<li class="fragment">2008 - first public working draft</li>
<li class="fragment">2011 - last call</li>
<li class="fragment">2012 - working draft</li>
<li class="fragment">2014 - planned for stable recommendation</li>
</ul>
</section>
<section>
<section>
<h2>What about the browsers?</h2>
<ul>
<li class="chrome">Chrome</li>
<li class="firefox">Firefox</li>
<li class="ie">Internet Explorer</li>
<li class="webkit">Safari</li>
<li class="opera">Opera</li>
</ul>
</section>
<section>
<h2><a href="http://html5readiness.com/">HTML5 & CSS3 Readiness</a></h2>
<img src="images/screenshots/html5-css3-readiness.png"/>
</section>
<section>
<h2><a href="http://caniuse.com/">Can I Use?</a></h2>
<img src="images/screenshots/caniuse-border-radius.png"/>
</section>
<section>
<h2><a href="http://html5please.com/">HTML5 Please</a></h2>
<img src="images/screenshots/html5-please.png"/>
</section>
</section>
<section>
<section>
<p><a href="http://dowebsitesneedtobeexperiencedexactlythesameineverybrowser.com/">Do web sites need to be experienced exactly the same in every
browser?</a></p>
<h2 class="fragment">NOPE.</h2>
</section>
<section>
<h2>Progressive Enhancement</h2>
<blockquote>uses web technologies in a layered fashion that allows everyone to access the basic content and functionality of a web page while also providing an enhanced version of the page to those with more advanced browser software.</blockquote>
<a href="http://en.wikipedia.org/wiki/Progressive_enhancement">-Wikipedia</a>
</section>
</section>
<section>
<section>
<h2>Helpful Resources</h2>
</section>
<section>
<img src="images/W3C_Icon.svg">
<p>
<a href="http://dev.w3.org/html5/spec/single-page.html">W3C HTML5 specs</a>
</p>
</section>
<section>
<img src="images/html5rocks.png"/>
<p>
<a href="http://www.html5rocks.com">http://www.html5rocks.com</a>
</p>
</section>
<section>
<img src="images/Mozilla-Developer-Network.png"/>
<p>
<a href="https://developer.mozilla.org">https://developer.mozilla.org</a>
</p>
</section>
<section>
<img src="images/html5doctor.png"/>
<p>
<a href="http://html5doctor.com">http://html5doctor.com</a>
</p>
</section>
</section>
<section>
<img src="images/html5.svg"/>
</section>
<section>
<h2>Builds on pre-existing specifications</h2>
<a href="http://dev.w3.org/html5/spec/single-page.html">HTML5 specs</a>
</section>
<section>
<h2>Marks some old things obsolete</h2>
<p>
<h4>Examples</h4>
<ul>
<li>Deprecated items (e.g. frame, frameset, noframes)</li>
<li>Presentational elements and attributes replaced by CSS (e.g.
font, big, center)</li>
</ul>
</p>
<a href="http://dev.w3.org/html5/spec/single-page.html#obsolete">reference</a>
</section>
<section>
<h2>Redefines a few things</h2>
<p>Gives some old elements semantic meaning and separates them from
presentation (e.g. b, i, strong, em)</p>
</section>
<section>
<h2>Adds a bunch of new features</h2>
<ul class="html5-features">
<li>
<span>semantics</span>
<img src="images/html5-logo/html5_semantics.svg" />
</li>
<li>
<span>offline & storage</span>
<img src="images/html5-logo/html5_offline_storage.svg" />
</li>
<li>
<span>device access</span>
<img src="images/html5-logo/html5_device_access.svg" />
</li>
<li>
<span>connectivity</span>
<img src="images/html5-logo/html5_connectivity.svg" />
</li>
<li>
<span>multimedia</span>
<img src="images/html5-logo/html5_multimedia.svg" />
</li>
<li>
<span>3D & graphics</span>
<img src="images/html5-logo/html5_effects_3d.svg" />
</li>
<li>
<span>performance</span>
<img src="images/html5-logo/html5_perfintegration.svg" />
</li>
<li>
<span>presentation</span>
<img src="images/html5-logo/html5_css3_styling.svg" />
</li>
</ul>
</section>
<section>
<section>
<h2>HTML5 Doctype</h2>
<pre><code class="xml">
<!DOCTYPE html>
</code></pre>
<p>
Minimum information required to ensure that a browser renders using
standards mode
</p>
</section>
<section>
<h2>Old Doctypes</h2>
<pre><code class="xml">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
</code></pre>
</section>
</section>
<section data-state="activity">
<section>
<h2>Activity: Enhance a web site using HTML5 & CSS3</h2>
<p>Enhance our
<a href="activity/women-in-computing/index.html">Women in Computing</a>
web site to use HTML5 & CSS3</p>
</section>
<section>
<h2>Switch the doctype to HTML5</h2>
<pre><code class="xml">
<!DOCTYPE html>
</code></pre>
</section>
</section>
<section>
<h2>
<img src="images/html5-logo/html5_semantics.svg" height="50">
Semantic HTML
</h2>
<blockquote cite="http://en.wikipedia.org/wiki/Semantic_HTML">The use of HTML markup to reinforce the semantics, or meaning, of the information in webpages rather than merely to define its presentation (look).</blockquote>
<a href="http://en.wikipedia.org/wiki/Semantic_HTML">-Wikipedia</a>
</section>
<section>
<h2>
<img src="images/html5-logo/html5_semantics.svg" height="50">
Semantics
</h2>
<p>
<h3>Give meaning to structure</h3>
</p>
</section>
<section>
<h2>
Not Semantic
</h2>
<pre><code>
<div id="header"></div>
</code></pre>
<pre><code>
<div class="nav"></div>
</code></pre>
<pre><code>
<div id="footer"></div>
</code></pre>
</section>
<section>
<h2>
Semantic
</h2>
<pre><code>
<header></header>
</code></pre>
<pre><code>
<nav></nav>
</code></pre>
<pre><code>
<footer></footer>
</code></pre>
</section>
<section>
<section>
<h2>New Structural Elements</h2>
</section>
<section>
<h2><section></h2>
<ul>
<li>Group together thematically related content</li>
<li>Similar to prior use of the div, but div has no semantic
meaning</li>
</ul>
</section>
<section>
<h2><header></h2>
<ul>
<li>Container for a group of introductory or navigational
aids</li>
<li>Document can have multiple header elements</li>
<li>E.g. One for the page, one for each section</li>
</ul>
</section>
<section>
<h2><footer></h2>
<ul>
<li>Contains information about its containing element</li>
<li>E.g. who wrote it, copyright, links to related content,
etc.</li>
<li>Document can have multiple footer elements</li>
<li>E.g. One for the page, one for each section</li>
</ul>
</section>
<section>
<h2><aside></h2>
<ul>
<li>Tangentially related content</li>
<li>E.g. sidebar, pull quotes</li>
</ul>
</section>
<section>
<h2><nav></h2>
<ul>
<li>Contains major navigational information</li>
<li>Usually a list of links</li>
<li>Often lives in the header</li>
<li>E.g. site navigation</li>
</ul>
</section>
<section>
<h2><article></h2>
<ul>
<li>Self-contained related content</li>
<li>E.g. blog posts, news stories, comments, reviews, forum
posts</li>
</ul>
</section>
</section>
<section>
<p>
<a href="http://html5doctor.com"><img src="images/html5doctor.png"/></a>
</p>
<p>
<a href="http://html5doctor.com/element-index/">element index</a>
</p>
<p>
<a href="http://html5doctor.com/downloads/h5d-sectioning-flowchart.pdf">
sectioning flowchart</a>
</p>
</section>
<section>
<h2>Not Semantic</h2>
<pre><code><body>
<div id="header">
<h1>Hi, I'm a header!</h1>
<div id="nav">
<ul>
<li><a href="foo">foo</a></li>
<li><a href="bar">bar</a></li>
</ul>
</div>
</div>
<div id="main">
<div class="article">foo</div>
<div class="article">bar</div>
</div>
<div id="footer">Hi, I'm a footer!</div>
</body></code></pre>
</section>
<section>
<h2>A lot of Divs</h2>
<pre><code><body>
<div id="header">
<h1>Hi, I'm a header!</h1>
<div id="nav">
<ul>
<li><a href="foo">foo</a></li>
<li><a href="bar">bar</a></li>
</ul>
</div>
</div>
<div id="main">
<div class="article">foo</div>
<div class="article">bar</div>
</div>
<div id="footer">Hi, I'm a footer!</div>
</body></code></pre>
<p>also known as div-itis</p>
</section>
<section>
<img src="images/all-the-divs.jpg" />
</section>
<section>
<h2>Semantic</h2>
<pre><code><body>
<header>
<h1>Hi, I'm a header!</h1>
<nav>
<ul>
<li><a href="http://www.foo.com">foo</a></li>
<li><a href="http://www.bar.com">bar</a></li>
</ul>
</nav>
</header>
<section>
<article>foo</article>
<article>bar</article>
</section>
<footer>Hi, I'm a footer!</footer>
</body></code></pre>
</section>
<section>
<h2>Semantic Markup Enhances</h2>
<ul>
<li class="fragment">Accessibility</li>
<li class="fragment">Searchability</li>
<li class="fragment">Internationalization</li>
<li class="fragment">Interoperability</li>
</ul>
<p class="fragment">It also helps treat the plague of div-itis!</p>
</section>
<section>
<section>
<h2>What about old browsers?</h2>
<a href="http://caniuse.com/#feat=html5semantic">
<img src="images/screenshots/caniuse-semantics.png"/>
</a>
</section>
<section>
<h2>
<a href="http://code.google.com/p/html5shiv/">HTML5Shiv</a>
</h2>
<p>HTML5 IE enabling script</p>
<pre><code><!--[if lt IE 9]>
<script src="html5shiv.js"></script>
<![endif]--></code></pre>
<blockquote class="fragment">polyfill (n): a JavaScript shim that replicates the standard API for older browsers</blockquote>
</section>
</section>
<section data-state="activity">
<section>
<h2>Activity: Enhance a web site using HTML5 & CSS3</h2>
<p>Enhance our
<a href="activity/women-in-computing/index.html">Women in Computing</a>
web site to use HTML5 & CSS3</p>
</section>
<section>
<h2>Modify the site to use semantic HTML</h2>
<p>
<ul>
<li>Change one small thing at a time</li>
<li>Remember to modify the CSS to match the HTML</li>
<li>You have 10-15 minutes to get started</li>
<li>You won't be able to change everything - if we have time, you
can continue at the end of the workshop</li>
</ul>
</p>
</section>
<section>
<p>If you get stuck, take a look at
<a href="activity/women-in-computing-example-solution/index.html">the example</a> for inspiration</p>
</section>
</section>
<section>
<section>
<h2>
<img src="images/html5-logo/html5_multimedia.svg" height="50">
Multimedia
</h2>
<p>Audio and video are first class citizens in HTML5</p>
</section>
<section>
<h2>
<img src="images/html5-logo/html5_multimedia.svg" height="50">
Multimedia
</h2>
<p>Useful as a replacement for flash on mobile devices</p>
<p>Flash makes mobile devices sad :(</p>
</section>
<section>
<section>
<h2>
<img src="images/html5-logo/html5_multimedia.svg" height="50">
Video
</h2>
<a href="https://www.youtube.com/html5">YouTube HTML5 Video Player</a>
</section>
</section>
<section>
<section>
<h2>
<img src="images/html5-logo/html5_multimedia.svg" height="50">
Audio
</h2>
<a href="http://www.jplayer.org/">jPlayer</a>
</section>
</section>
</section>
<section>
<section>
<h2>
<img src="images/html5-logo/html5_effects_3d.svg" height="50">
Canvas
</h2>
<ul>
<li>Environment for creating dynamic images</li>
<li>Canvas element + javascript = dynamic content!</li>
</ul>
</section>
<section>
<h2>
<img src="images/html5-logo/html5_effects_3d.svg" height="50">
Canvas
</h2>
<ul>
<li>
<a href="http://www.datapointed.net/visualizations/math/factorization/animated-diagrams/#">Animated Factorization</a>
</li>
<li>
<a href="http://bomomo.com/">http://bomomo.com/</a>
</li>
<li>
<a href="http://canvasrider.com/">http://canvasrider.com/</a>
</li>
<li>
<a href="http://lights.elliegoulding.com/">http://lights.elliegoulding.com/</a>
</li>
</ul>
</section>
</section>
<section>
<section>
<h2>
<img src="images/html5-logo/html5_device_access.svg" height="50">
Device Access
</h2>
<p>Rich, device-aware features and experiences</p>
</section>
<section>
<h2>
<img src="images/html5-logo/html5_device_access.svg" height="50">
Geolocation
</h2>
<a href="https://maps.google.com/">Google Map</a>
</section>
<section>
<h2>
<img src="images/html5-logo/html5_device_access.svg" height="50">
Audio/Video Input
</h2>
<ul>
<li>camera</li>
<li>microphone</li>
</ul>
</section>
</section>
<section>
<section>
<h2>
<img src="images/html5-logo/html5_offline_storage.svg" height="50">
Storage
</h2>
<a href="http://html5demos.com/storage">storage</a>
<a href="http://html5demos.com/storage-events">storage-events</a>
</section>
</section>
<section>
<img src="images/css3.svg"/>
</section>
<section>
<h2>CSS3 Background</h2>
<ul>
<li>Series of modules that are designed to be implemented separately
and independently from each other</li>
<li>Enhances display and interactions</li>
</ul>
</section>
<section>
<h2>New Selectors</h2>
</section>
<section>
<section>
<h2>Attribute Selectors</h2>
<ul>
<li><strong>E[foo^="bar"]</strong> an element whose "foo" attribute value begins exactly with the string "bar"</li>
<li><strong>E[foo$="bar"]</strong> an element whose "foo" attribute value ends exactly with the string "bar"</li>
<li><strong>E[foo*="bar"]</strong> an element whose "foo" attribute value contains the substring "bar"</li>
</ul>
</section>
<section class="attribute-selectors">
<h2>Attribute Selectors</h2>
<pre><code>
div[foo^="bar"] {
color: red;
}
div[foo$="bar"] {
background-color: red;
}
div[foo*="bar"] {
border: solid 5px red;
}
</code></pre>
<article>
<div foo="barley">foo="barley"</div>
<div foo="lumbar">foo="lumbar"</div>
<div foo="embark">foo="embark"</div>
</article>
</section>
</section>
<section>
<section>
<h2>:nth-child pseudo-class selector</h2>
<p>matches an element that has position <em>an+b</em></p>
<pre><code class="css">
element:nth-child(an + b) { style properties }
</code></pre>
<h4>some examples</h4>
<ul>
<li><strong>3</strong> - selects the third element</li>
<li><strong>4n</strong> - selects every fourth element</li>
<li><strong>even</strong> - selects even elements</li>
<li><strong>odd</strong> - selects odd elements</li>
</ul>
</section>
<section class="nth-child-table">
<h2>:nth-child</h2>
<pre><code>
tbody tr:nth-child(an + b) { backround-color: red; }
</code></pre>
<p>
<input type="text" id="nth-child-value" value="" />
<input type="button" value="change"/>
</p>
<table>
<thead>
<tr>
<th>n</th>
<th>2n+1</th><th>4n+1</th><th>4n+4</th>
<th>4n </th><th>5n-2</th><th>-n+3</th>
</tr>
</thead>
<tbody>
<tr>
<th>0 </th>
<td>1 </td><td>1 </td><td>4 </td>
<td>- </td><td>- </td><td>3 </td>
</tr>
<tr>
<th>1 </th>
<td>3 </td><td>5 </td><td>8 </td>
<td>4</td><td>3</td><td>2</td>
</tr>
<tr>
<th>2 </th>
<td>5 </td><td>9 </td><td>12</td>
<td>8</td><td>8</td><td>1</td>
</tr>
<tr>
<th>3 </th>
<td>7 </td><td>13</td><td>16</td>
<td>12</td><td>13</td><td>- </td>
</tr>
<tr>
<th>4 </th>
<td>9 </td><td>17</td><td>20</td>
<td>16</td><td>18</td><td>- </td>
</tr>
<tr>
<th>5 </th>
<td>11</td><td>21</td><td>24</td>
<td>20</td><td>23</td><td>- </td>
</tr>
</tbody>
</table>
<a href="http://css-tricks.com/how-nth-child-works/">reference</a>
</section>
</section>
<section>
<section>
<h2>Some other pseudo-class Selectors</h2>
<ul>
<li>
<strong>E:last-child</strong> an element, last child of its parent
</li>
<li>
<strong>E:only-child</strong> an element, only child of its parent
</li>
<li>
<strong>E:empty</strong> an element that has no children (including text nodes)
</li>
<li>
<strong>E:not</strong> an element that does not match simple selector
</li>
</ul>
</section>
<section class="pseudo-enabled">
<h2>:enabled & :disabled</h2>
<p>a user interface element which is enabled</p>
<pre><code>
input:enabled { background-color: red; }
input:disabled { background-color: grey; }
</code></pre>
Enabled: <input type="textbox"/>
Disabled: <input type="textbox" disabled/>
</section>
<section class="pseudo-checked">
<h2>:checked</h2>
<p>a user interface element which is checked</p>
<pre><code>
input:checked + label {
color: red;
}
</code></pre>
<p>
<input type="checkbox" id="checkbox1">
<label for="checkbox1">checkbox</label>
</p>
<p>
<input type="radio" name="radio" id="radio1" />
<label for="radio1">radio</label>
<input type="radio" name="radio" id="radio2" />
<label for="radio2">radio</label>
<input type="radio" name="radio" id="radio3" />
<label for="radio3">radio</label>
</p>
</section>
</section>
<section>
<section>
<h2>Vendor Prefixes</h2>
<a href="http://caniuse.com/#feat=border-radius">
<img src="images/screenshots/caniuse-border-radius.png">
</a>
</section>
<section>
<h2>Vendor Prefixes</h2>
<ul>
<li>Flags it as a work-in-progress</li>
<li>When finished, the browser should support the non-prefixed
name</li>
</ul>
</section>
<section>
<h2>Vendor Prefixes</h2>
<h4>each browser has their own</h4>
<ul>
<li class="chrome">-webkit-</li>
<li class="firefox">-moz-</li>
<li class="ie">-ms-</li>
<li class="webkit">-webkit-</li>
<li class="opera">-o-</li>
</ul>
</section>
<section>
<h2>Vendor Prefixes</h2>
<pre><code>
.example{
-moz-property: value;
-ms-property: value;
-webkit-property: value;
-o-property: value;
property: value;
}
</code></pre>
<h4>order matters</h4>
<p>the non-prefixed property should always go last</p>
</section>
<section>
<h2>Vendor Prefixes</h2>
<ul>
<li>A little annoying, but totally worth it!</li>
<li>Tools available to help (e.g. Compass)</li>
</ul>
</section>
</section>
<section>
<section>
<h2>border-radius</h2>
<p>Allows you to create rounded corners</p>
</section>
<section class="border-radius">
<h2>border-radius</h2>
<pre><code>
#example1 { border-radius: <span class="border-radius-value">20</span>px; }
</code></pre>
<p>
<span>
<span class="border-radius-value">20</span>px on all corners
</span>
<input type="range" min="0" max="100" value="20">
</p>
<article>
<div class="example example1">
</div>
</article>
</section>
<section class="border-radius">
<h2>border-radius</h2>
<pre><code>
#example2 { border-radius: <span class="border-radius-value">10</span>px <span class="border-radius-value">40</span>px; }
</code></pre>
<p>
<span class="border-radius-value">10</span>px on top left & bottom right</span>
<input type="range" min="0" max="100" value="10">
</p>
<p>
<span><span class="border-radius-value">40</span>px on top right & bottom left</span>
<input type="range" min="0" max="100" value="40">
</p>
<article>
<div class="example example2">
</div>
</article>
</section>
<section class="border-radius">
<h2>border-radius</h2>
<pre><code>
#example3 { border-radius: <span class="border-radius-value">10</span>px <span class="border-radius-value">20</span>px <span class="border-radius-value">40</span>px <span class="border-radius-value">80</span>px; }
</code></pre>
<p>
<span><span class="border-radius-value">10</span>px on top left</span>
<input type="range" min="0" max="100" value="10">
</p>
<p>
<span><span class="border-radius-value">20</span>px top right</span>
<input type="range" min="0" max="100" value="20">
</p>
<p>
<span><span class="border-radius-value">40</span>px bottom right</span>
<input type="range" min="0" max="100" value="40">
</p>
<p>
<span><span class="border-radius-value">80</span>px bottom left</span>
<input type="range" min="0" max="100" value="80">
</p>
<article>
<div class="example example3">
</div>
</article>
</section>
<section>
<h2>border-radius</h2>
<pre><code>
#example4 {
border-radius: 50%;
}
</code></pre>
<p>Creates an ellipse</p>
<p>Creates a circle if height == width</p>
<article class="border-radius">
<div class="example4">
</div>
<div class="example5">
</div>
</article>
</section>
</section>