-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html~
1515 lines (1234 loc) · 41 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>Introduction to HTML</title>
<meta name="description" content="HTML5 HTML Intro For
CMPUT404"/>
<meta name="author" content="Abram Hindle"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<link rel="stylesheet" href="css/reveal.min.css">
<link rel="stylesheet" href="css/theme/default.css" id="theme">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- If the query includes 'print-pdf', use the PDF print sheet -->
<script>
document.write( '<link rel="stylesheet" href="css/print/' + ( window.location.search.match( /print-pdf/gi ) ? 'pdf' : 'paper' ) + '.css" type="text/css" media="print">' );
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section>
<h1>HTML5</h1>
<h3>Forget all that bad HTML
you already know!</h3>
<p>
<small>Created
by <a href="http://softwareprocess.es">Abram
Hindle</a>
</small>
</p>
</section>
<section>
<h2>If you know HTML Already</h2>
<p>
<ul>
<li>How often do you use
<div>?</li>
<li>How often do you use
<table>?</li>
<li>Do you use <font>?</li>
</p>
<aside class="notes">
</aside>
</section>
<section>
<h2>HTML Has Changed</h2>
<p>
You can still use all
that stuff you
learned.</p>
<p> But there's newer
better ways that will make
your pages just look
better!</p>
<p> So bear with me if
you already know HTML and
consider this an upgrade
of your skills!</p>
<aside class="notes">
</aside>
</section>
<section data-markdown>
<script type="text/template">
## Let's start HTMLing!
It's best to start
from the bare
essentials. You can
validate this HTML
using [http://validator.w3.org/check](http://validator.w3.org/check).
```
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<meta charset="UTF-8"/>
</head>
<body>
Here's your minimal and validating HTML page.
</body>
</html>
```
</script>
</section>
<section data-markdown>
<script type="text/template">
## Don't forget!
You need to tell the
world that this is a
modern HTML file!
Put your DOCTYPE at
the top!
Also enclose your content in the HTML tag!
```
<!DOCTYPE html>
<html>
...
</html>
```
</script>
</section>
<!-- ######################## START MARKDOWN SLIDE ########################## -->
<section data-markdown>
<script type="text/template">
## Head /Header
The head tag is where
we put information
about the webpage. You
will usually include a title here.
Meta tags contain meta
information for
browsers and other
tools to help
interpret.
````
<head>
<title>Page Title</title>
<meta charset="UTF-8"/>
<meta name="description" content="Example Page"/>
<meta name="author" content="Abram Hindle"/>
<!-- proprietary extensions -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<!-- mobile viewport information -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!-- stylesheets / css -->
<link rel="stylesheet" href="css/reveal.min.css">
<link rel="stylesheet" href="css/theme/default.css" id="theme">
<link rel="stylesheet" href="lib/css/zenburn.css">
</head>
````
</script>
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<!-- ######################## START MARKDOWN SLIDE ########################## -->
<section data-markdown>
<script type="text/template">
## Body
````
<body>
<p>Visible content goes here.</p>
<p>Consider that you should not directly specify layout information
here but that you should mark up blocks with a class allowing you to
apply layouts later. You can abstract layout</p>
</body>
````
</script>
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<!-- ######################## START MARKDOWN SLIDE ########################## -->
<section data-markdown>
<script type="text/template">
## Tags
Since many HTML parser expect XML like tags all tags should be
closed to allow for ease of reading and parsing.
This is not a requirement of the HTML spec.
Start Tags are enclosed in < and >
End Tags are enclosed in </ and >
````
<tag>
<enclosedtag>
</enclosedtag>
</tag>
````
Void or atomic Tags are enclosed in < and />;
````
<tag>
<atomictag/>
<voidtag/>
</tag>
````
</script>
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<!-- ######################## START MARKDOWN SLIDE ########################## -->
<section data-markdown>
<script type="text/template">
## Tags
Since many HTML parser expect XML like tags all tags should be
closed to allow for ease of reading and parsing.
This is not a requirement of the HTML spec.
Tags can be any capitalization in HTML, in XML they are case
sensitive and must be lower case. Stick to lower-case tags if they are
HTML to stay XHTML compliant.
</script>
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<!-- ######################## START MARKDOWN SLIDE ########################## -->
<section data-markdown>
<script type="text/template">
## Paragraph tag: <p>
You might have been taught that you can use these <p> tags to
start and end paragraphs.
The new style is to enclose paragraphs.
````
<p>
Now bears us onward one of the hard margins,
And so the brooklet's mist o'ershadows it,
From fire it saves the water and the dikes.
</p>
<p>
Even as the Flemings, 'twixt Cadsand and Bruges,
Fearing the flood that tow'rds them hurls itself,
Their bulwarks build to put the sea to flight;
</p>
````
We can use CSS to style these text blocks. Whitespace in the <p>
block doesn't matter.
</script>
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<!-- ######################## START HTML SLIDE ########################## -->
<section>
<h2>Paragraph Tag</h2>
<p>That code now looks like:</p>
<blockquote>
<p>
Now bears us onward one of the hard margins,
And so the brooklet's mist o'ershadows it,
From fire it saves the water and the dikes.
</p>
<p>
Even as the Flemings, 'twixt Cadsand and Bruges,
Fearing the flood that tow'rds them hurls itself,
Their bulwarks build to put the sea to flight;
</p>
</blockquote>
</section>
<!-- ######################## END HTML SLIDE ########################## -->
<!-- ######################## START MARKDOWN SLIDE ########################## -->
<section data-markdown>
<script type="text/template">
## Paragraph tag: <p> and <br>
The previous example broke up the explicit lines from that canto.
We can make line-breaks explicit with <br/>.
You might have been taught that you can use <br>, you can but it
isn't XHTML or XML complaint.
````
<p>
Now bears us onward one of the hard margins,<br/>
And so the brooklet's mist o'ershadows it,<br/>
From fire it saves the water and the dikes.<br/>
</p>
<p>
Even as the Flemings, 'twixt Cadsand and Bruges,<br/>
Fearing the flood that tow'rds them hurls itself,<br/>
Their bulwarks build to put the sea to flight;<br/>
</p>
````
We can use CSS to style these text blocks. Whitespace in the <p>
block doesn't matter.
</script>
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<!-- ######################## START HTML SLIDE ########################## -->
<section>
<h2>Paragraph Tag and <br></h2>
<p>That code now looks like:</p>
<blockquote>
<p>
Now bears us onward one of the hard margins,<br/>
And so the brooklet's mist o'ershadows it,<br/>
From fire it saves the water and the dikes.<br/>
</p>
<p>
Even as the Flemings, 'twixt Cadsand and Bruges,<br/>
Fearing the flood that tow'rds them hurls itself,<br/>
Their bulwarks build to put the sea to flight;<br/>
</p>
</blockquote>
</section>
<!-- ######################## END HTML SLIDE ########################## -->
<!-- ######################## START MARKDOWN SLIDE -- -- ########################## -->
<section>
<div data-markdown>
<script type="text/template">
## <img> : The Image Tag
We want to show images, we cannot embed them in HTML easily so we use
hyperlinks (URIs) to reference them and include them.
Remember to include alt tags so they are machine and human-readable.
````
<img src="images/plasma.png" alt="Plasma Pattern"/>
<!-- scaling -->
<img src="images/plasma.png" alt="Plasma Pattern" width="30"/>
<!-- scaling without respecting aspect -->
<img src="images/plasma.png" alt="Plasma Pattern" width="30" height="60"/>
````
</script>
</div>
<img src="images/plasma.png" alt="Plasma Pattern"/>
<img src="images/plasma.png" alt="Plasma Pattern" width="30"/>
<img src="images/plasma.png" alt="Plasma Pattern" width="30" height="60"/>
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<!-- ######################## START MARKDOWN SLIDE -- -- ########################## -->
<section>
<div data-markdown>
<script type="text/template">
## <a> : The Anchor Tag
We wouldn't have hypertext without hyperlinks!
Anchor tags let us link to other documents or locations. The href
attribute links to a URL. The URL can be relative to the location of
the current page. Anchor tags used to place anchors on pages, but in
HTML 5 they just navigate to ID'd sections now.
````
<a href="http://slashdot.org">Slashdot.org: News for Nerds Stuff that
Matters</a><br/>
<a href="http://cnn.com">T</a><a href="http://msn.com">a</a>
<a href="http://softwareprocess.es/">g</a><a href="http://ualberta.ca">s</a>
don't have to be very long.<br/>
<a href="../">The a directory down!</a> Relative Link
````
</script>
</div>
<a href="http://slashdot.org">Slashdot.org: News for Nerds Stuff that
Matters</a><br/>
<a href="http://cnn.com">T</a><a href="http://msn.com">a</a>
<a href="http://softwareprocess.es/">g</a><a href="http://ualberta.ca">s</a>
don't have to be very long.<br/>
<a href="../">The a directory down!</a> Relative Link
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<!-- ######################## START HTML SLIDE ########################## -->
<section>
<h2>Text Layout Philosophy</h2>
<p> Let the user agent decide how to display the text. You don't
need to control everything. But provide the appropriate semantics
first. Then apply layout information to those semantics.</p>
<p>If you want something to show up in a certain make a CSS class
and style a span or a div or a paragraph that way.</p>
<p>Don't force the
situation with a table.</p>
</section>
<!-- ######################## END HTML SLIDE ########################## -->
<!-- ######################## START MARKDOWN SLIDE ########################## -->
<section data-markdown>
<script type="text/template">
## <div> and <span> tags
<div> and <span> tags have no particular meaning.
<div> will cause a line break before it is displayed.
<span> will be inlined.
````
<div>
<span>Now bears us onward one of the hard margins,</span><br/>
And so the brooklet's mist o'ershadows it,<br/>
From fire it saves the water and the dikes.<br/>
</div>
<div>
Even <span>as the Flemings</span>, 'twixt Cadsand and Bruges,<br/>
Fearing the flood that tow'rds them hurls itself,<br/>
Their bulwarks build to put the sea to flight;<br/>
</div>
````
</script>
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<section>
<h2><div> and <span> tags</h2>
<p>Looks like this:</p>
<blockquote>
<div>
<span>Now bears us onward one of the hard margins,</span><br/>
And so the brooklet's mist o'ershadows it,<br/>
From fire it saves the water and the dikes.<br/>
</div>
<div>
Even <span>as the Flemings</span>, 'twixt Cadsand and Bruges,<br/>
Fearing the flood that tow'rds them hurls itself,<br/>
Their bulwarks build to put the sea to flight;<br/>
</div>
</blockquote>
<p>It did not change.</p>
</section>
<!-- ######################## START MARKDOWN SLIDE ########################## -->
<section data-markdown>
<script type="text/template">
## <div> and <span> tags: With Style
We can add a style attribute to these tags
````
<div>
<span style="background-color:#AAAAAA;font-weight:bold">
Now bears us onward one of the hard margins,</span><br/>
And so the brooklet's mist o'ershadows it,<br/>
From fire it saves the water and the dikes.<br/>
</div>
<div style="font-size:150%">
Even <span style="color:red">as the Flemings</span>, 'twixt Cadsand and Bruges,<br/>
Fearing the flood that tow'rds them hurls itself,<br/>
Their bulwarks build to put the sea to flight;<br/>
</div>
````
</script>
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<section>
<h2><div> and <span> tags: With Style</h2>
<p>Looks like this:</p>
<blockquote>
<div>
<span style="background-color:#AAAAAA;font-weight:bold">
Now bears us onward one of the hard margins,</span><br/>
And so the brooklet's mist o'ershadows it,<br/>
From fire it saves the water and the dikes.<br/>
</div>
<div style="font-size:150%">
Even <span style="color:red">as the Flemings</span>, 'twixt Cadsand and Bruges,<br/>
Fearing the flood that tow'rds them hurls itself,<br/>
Their bulwarks build to put the sea to flight;<br/>
</div>
</blockquote>
</section>
<!-- ######################## START MARKDOWN SLIDE ########################## -->
<section data-markdown>
<script type="text/template">
## Style
I showed how to modify the style properties of tags. Tags can have
attributes defined liked so:
````
<tag attribute1="value1" attribute2="val2"/>
````
We added style attributes. The style attributes are Cascading Style
Sheet properties.
Cascading refers to accumulation of CSS properties (like color,
font-weight, etc.).
````
<span style="zoom:2;color:blue;">Hello!
<span style="zoom:2;font-weight: bold;">Hello!
<span style="zoom:2;color:red;box-shadow: 10px 10px 5px #888888;">Hello!</span>
</span>
</span>
````
</script>
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<section>
<h2>Style</h2>
<p>Looks like this:</p>
<blockquote>
<p>
<span style="zoom:2;color:blue;">Hello!
<span style="zoom:2;font-weight: bold;">Hello!
<span style="zoom:2;color:red;box-shadow: 10px 10px 5px #888888;">Hello!</span>
</span>
</span>
</p>
</blockquote>
</section>
<!-- ######################## START MARKDOWN SLIDE ########################## -->
<section data-markdown>
<script type="text/template">
## Cascading Style Sheets
* Cascades
* Children Inherit Properties
* Style
* Properties refer to style properties such as layout, position,
color, font, background, padding, borders
* Sheets
* Apply to a page, change a page.
</script>
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<!-- ######################## START MARKDOWN SLIDE ########################## -->
<section data-markdown>
<script type="text/template">
## Cascading Style Sheets
CSS can applied on a per tag level, but can also be applied globally.
````
<!-- Include a file of CSS -->
<link href="path/to/cssfile.css" rel="stylesheet">
````
````
<!-- Inline CSS -->
<style type="text/css">
.angry {
font-weight:900;
zoom: 3;
}
.angry:nth-child(odd)
{
color:green;
transform:rotate(7deg);
-webkit-transform:rotate(7deg); /* Safari and Chrome */
float: left;
}
.angry:nth-child(even)
{
color:red;
transform:rotate(-12deg);
-webkit-transform:rotate(-12deg); /* Safari and Chrome */
float: right;
}
</style>
<p style="color:orange">Apply style directly</p>
<div>
<div class="angry">HULK</div> <div class="angry">SMASH!</div>
</div>
````
</script>
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<section>
<h2>Style</h2>
<p>Looks like this:</p>
<blockquote>
<style type="text/css">
.angry {
font-weight:900;
zoom: 3;
}
.angry:nth-child(odd)
{
color:green;
transform:rotate(7deg);
-webkit-transform:rotate(7deg); /* Safari and Chrome */
float: left;
}
.angry:nth-child(even)
{
color:red;
transform:rotate(-12deg);
-webkit-transform:rotate(-12deg); /* Safari and Chrome */
float: right;
}
</style>
<p style="color:orange">Apply style directly</p>
<div>
<div class="angry">HULK</div> <div class="angry">SMASH!</div>
</div>
</blockquote>
</section>
<!-- ######################## START MARKDOWN SLIDE ########################## -->
<section data-markdown>
<script type="text/template">
## CSS: Properties To Know!
* color -- color of the text or object
* color:green
* color:#abc (short form)
* font-family -- the font
* font-family:"Times New Roman"
* font-family:"Verdana"
* font-size -- the font size
* font-size:10px;
* font-size:10pt;
* font-size:large;
* font-size:200%;
* font-style -- normal, italic, oblique
* font-style:normal;
</script>
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<!-- ######################## START MARKDOWN SLIDE ########################## -->
<section data-markdown>
<script type="text/template">
## CSS Backgrounds
* background-color -- Background color of a div or a span
````
.bg1 { background-color:red }
.bg2 { background-color:#aabbcc }
````
* background-image -- Background image
````
.bg3 {background-image:url('images/plasma.png');}
````
* On this HTML
````
<p class="bg1">This is example 1</p>
<p class="bg2">This is example 2</p>
<p class="bg3">This is example 3.<br/>
This is example 3.<br/>
This is example 3.<br/>
</p>
````
</script>
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<!-- ######################## START HTML SLIDE ########################## -->
<section>
<h2>CSS Backgrounds</h2>
<style type="text/css">
.bg1 { background-color:red }
.bg2 { background-color:#aabbcc }
.bg3 {background-image:url('images/plasma.png');}
</style>
<p class="bg1">This is example 1</p>
<p class="bg2">This is example 2</p>
<p class="bg3">This is example 3.<br/>
This is example 3.<br/>
This is example 3.<br/>
</p>
</section>
<!-- ######################## END HTML SLIDE ########################## -->
<!-- ######################## START MARKDOWN SLIDE ########################## -->
<section data-markdown>
<script type="text/template">
## CSS Selectors
Did you notice I had .bg1 and .bg2 in the previous example?
Those are CSS selectors. .bg1 and .bg2 are classes. We can use HTML
attributes to label tags with classes that allow the tags to inherit
CSS style information.
````
.bg1 { background-color:red; }
.bg2 { background-color:#aabbcc; }
.bg3 {background-image:url('images/plasma.png');}
````
</script>
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<!-- ######################## START MARKDOWN SLIDE ########################## -->
<section>
<div data-markdown>
<script type="text/template">
## CSS Selectors
* .class
* class selectors let you mark up HTML with a class
````
.highlight { background-color:yellow; }
````
````
<p class="highlight">ALERT!</p>
````
* You can also combine classes with HTML tag selectors; this example
makes p tags with class="highlight" orange instead of yellow. You can
override other CSS as well.
````
p.highlight { background-color:orange; }
````
````
<p class="highlight">ALERT in orange!</p>
````
</script>
</div>
<style type="text/css">
.highlight { background-color:yellow; }
p.highlight { background-color:orange; }
</style>
<div class="highlight">Here's some highlighted stuff in a div</div>
<p class="highlight">ALERT in orange!</p>
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<!-- ######################## START MARKDOWN SLIDE ########################## -->
<section data-markdown>
<script type="text/template">
## CSS Selectors
* \#id
* ID selectors are like class selectors except they aim at the one
tag with the id="idtag" as an attribute.
````
#yellowtag { background-color:yellow; }
````
````
<p id="yellowtag">Yellow Tag Sale!</p>
````
</script>
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<!-- ######################## START MARKDOWN SLIDE -- -- ########################## -->
<section>
<div data-markdown>
<script type="text/template">
## CSS Selectors
* element
* element selectors let you style entire HTML elements (tags).
* Important because you might want to theme all divs or imgs or links
````
p { background-color:yellow; }
````
````
<p>Great. Everything is yellow now.</p>
````
</script>
</div>
<style type="text/css">
#fake1 { background-color:yellow }
</style>
<p id="fake1">Great. Everything is yellow now.</p>
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<!-- ######################## START MARKDOWN SLIDE -- -- ########################## -->
<section>
<div data-markdown>
<script type="text/template">
## CSS Selectors
* :context
* Selectors that behave depending on the context
* Can be chained with other selectors
* :hover - when the mouse is over
* :active - active link
* :first-letter - operate on the first letter
* :nth-child(2) - second child
````
span.x:hover { background-color:yellow; }
.x:nth-child(even) { background-color:red; }
````
````
<span class="x">How</span>
<span class="x">is</span>
<span class="x">this</span>
<span class="x">going</span>
<span class="x">to</span>
<span class="x">work?</span>
````
</script>
</div>
<style type="text/css">
span.x:hover { background-color:yellow; }
.x:nth-child(even) { background-color:red; }
</style>
<p>
<span class="x">How</span>
<span class="x">is</span>
<span class="x">this</span>
<span class="x">going</span>
<span class="x">to</span>
<span class="x">work?</span>
</p>
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<!-- ######################## START MARKDOWN SLIDE ########################## -->
<section>
<div data-markdown>
<script type="text/template">
## CSS Positioning
* position: (use left, right, top, bottom)
* fixed -- stays on one spot in the browser
````
p.fixed { position: fixed; right: 10%; top: 20%; }
````
* relative -- position relative to where it normally goes.
````
<!-- a little to the left -->
p.relative { position: relative; left:-10px; }
p.bigrelative { position: relative; left:-100px; }
````
</script>
</div>
<blockquote>
<style type="text/css">
p.fixed { position: fixed; right: 10%; top: 20%; }
p.relative { position: relative; left:-10px; }
p.bigrelative { position: relative; left:-100px; }
</style>
<p class="fixed">FIXED</p>
<p>!relative</p>
<p class="relative">Relative</p>
<p class="bigrelative">Big Relative</p>
</blockquote>
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<!-- ######################## START MARKDOWN SLIDE ########################## -->
<section>
<div data-markdown>
<script type="text/template">
## CSS Positioning
* position: (use left, right, top, bottom)
* absolute -- absolute positioning relative to the first parent that
was positioned (often the page itself).
````
p.abs { position: absolute; left: 10%; top: 5%; }
````
````
<p class="abs">Ab-solutely!</p>
````
* z-index can be used to order overlapping elements!
````
p.redbox { z-index: 5; position: absolute; right: 11%; top: 10%;
background-color:red;}
p.bluebox { position: absolute; right: 15%; top: 15%;
background-color:blue;}
````
````
<p class="redbox">Redbox!</p>
<p class="bluebox">Bluebox!</p>
````
</script>
</div>
<style type="text/css">
p.abs { position: absolute; left: 10%; top: 5%; }
p.redbox { z-index: 5; position: absolute; right: 11%; top: 10%; background-color:red;}
p.bluebox { position: absolute; right: 15%; top: 15%; background-color:blue;}
</style>
<p class="redbox">Redbox!</p>
<p class="bluebox">Bluebox!</p>
<p class="abs">Ab-solutely!</p>
</section>
<!-- ######################## END MARKDOWN SLIDE ########################## -->
<!-- ######################## START HTML SLIDE ########################## -->
<section>
<h2>CSS Help!</h2>
<p> CSS is spread across many specs, so it is hard to really get a
clear grasp on it.</p>
<ul>
<li><a href="">CSS Specifications</a> -- Not all of these are
available or work</li>
<li><a href="http://www.w3schools.com/css/css3_intro.asp">CSS3
Tutorial</a> from W3Schools.</li>
<li><a href="http://www.w3schools.com/css/default.asp">CSS
Tutorial</a> from W3Schools.</li>
<li><a href="http://www.w3.org/TR/CSS2/propidx.html">Full
property table from CSS2</a> -- The CSS2 Spec is more
encapsulated in one place</li>
</ul>
</section>
<!-- ######################## END HTML SLIDE ########################## -->
<!-- ######################## START HTML SLIDE ########################## -->
<section>
<h2>HTML for User Interfaces</h2>
<p> The HTML Form elements let us accept input from browsers in a
structured way and form HTTP GETs and POSTs.</p>