forked from girldevelopit/gdi-featured-html-css-intermediate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
executable file
·1892 lines (1826 loc) · 75.9 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>Intermediate HTML/CSS & Intro to Responsive Design ♥ Girl Develop It Boulder</title>
<meta name="description" content="">
<meta name="author" content="Cara Jo Miller, adapted by Lisa Smith">
<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/simple.css" id="theme">
<!-- For syntax highlighting -->
<!-- light editor-->
<link rel="stylesheet" href="reveal/lib/css/light.css">
<!-- dark editor<link rel="stylesheet" href="reveal/lib/css/dark.css">-->
<link rel="stylesheet" href="css/slides.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 = 'reveal/css/print/pdf.css';
document.getElementsByTagName('head')[0].appendChild(link);
}
</script>
<link rel="icon" type="image/x-icon" href="reveal/favicon.ico" />
<!--[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">
<!-- Opening -->
<section>
<img src="images/gdi_logo_badge.png" style="padding: 10px; width:400px;" alt="gdi" />
<h3>Intermediate HTML/CSS & Intro to Responsive Design</h3>
</section>
<section>
<h2>Welcome!</h2>
<h4 class="blue">Wifi Info</h4>
<p>
<strong>Network: </strong></p>
<p>
<strong>Password: </strong></p>
<br/>
<h3>Download workshop files</h3>
<p>Please download workshop files at:<br />
<a href="http://girldevelopit.github.io/gdi-featured-intermediate-html-css/workshop-files.zip">http://girldevelopit.github.io/gdi-featured-intermediate-html-css/workshop-files.zip</a></p>
</section>
<section>
<h2>Thanks to our host:</h2>
</section>
<section>
<h3>Class notes</h3>
<p>All slides are available at:<br />
<a href="http://girldevelopit.github.io/gdi-featured-intermediate-html-css/">http://girldevelopit.github.io/gdi-featured-intermediate-html-css/</a></p>
</section>
<!-- Welcome-->
<section class="hide-pdf">
<h3>Welcome!</h3>
<div class="left-align">
<p>Girl Develop It is here to provide affordable and accessible programs to learn software through mentorship and hands-on instruction.</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>
</div>
</section>
<section class="hide-pdf">
<h3>Thank you to our Teaching Assistants today</h3>
</section>
<section class="hide-pdf">
<h3>About your instructor</h3>
</section>
<section class="hide-pdf">
<h3>Now it's all about you!</h3>
<ul>
<li>Tell us who you are.</li>
<li>What do you hope to get out of this class?</li>
<li>Unlimited amount of money - where would you travel to?</li>
</section>
<section>
<h2>What we'll be covering in this class</h2>
<p>We'll be jumping into HTML/CSS right where the beginner class left off.</p>
<p>We will not be going over the previous class, we just don't have the time!</p>
</section>
<section>
<h3>We will be building a profile site from scratch</h3>
<img src="images/gdi-profile-layout.png" alt="today's project" />
</section>
<section data-background="#f05b62">
<h1 style="color: #fafafa;">Workshop files</h1>
</section>
<section>
<h3>Workshop files</h3>
<p>Last reminder to download the files for today's class! </p>
<ul>
<li>We have provided a folder that contains sample images for you to use today. We encourage you to be creative so don't feel like you're restricted to these images</li>
<li>We've also included a blank index.html file for you to work from, as well as the final site for you to use as a reference if you get stuck.</li>
</ul>
</section>
<section>
<h3>Folder Structure</h3>
<p>We've set up the folder structure for the site today to reflect common practices used.</p>
<img src="images/folder-structure.png" alt="folder structure" style="width:500px;"/>
</section>
<section>
<h3>Cheat sheets</h3>
<p>We've provided a copy of the site you'll be building today with notes on how to break down the layout of the page.</p>
</section>
<section data-background="#f05b62">
<h1 style="color: #fafafa;">Common Applications</h1>
</section>
<section>
<h3>Common Applications</h3>
<p>HTML & CSS are awesome, right?</p>
<p>But how do people use them
<span class="green">really?</span>
<p>Here's a few things we'll be covering today:</p>
<ul>
<li class="fragment">Horizontal & fixed navigation</li>
<li class="fragment">Heros with full bleed background images</li>
<li class="fragment">Border-radius on images & elements</li>
<li class="fragment">Custom font-faces</li>
<li class="fragment">Three column layouts</li>
<li class="fragment">Fancy buttons</li>
</ul>
</section>
<section data-background="#f05b62">
<h1 style="color: #fafafa;">Standard Practices</h1>
</section>
<section>
<h3>Standard Practices</h3>
<ul>
<li class="fragment">Reset CSS files</li>
<li class="fragment">Standard widths and sizes</li>
<li class="fragment">Containers for layout</li>
</ul>
</section>
<section>
<h3>Reset CSS</h3>
<p>Even though HTML is the structure and CSS is the design, some HTML elements have default styles</p>
<p>Different browsers display these things differently. A reset gets rid of these inconsistencies.</p>
<p class="fragment">
<strong>Examples include:</strong>
</p>
<ul class="fragment">
<li>Bulleted lists like this one have standard bullets</li>
<li>Paragraphs & headings have default padding</li>
<li>Links are blue and underlined</li>
</ul>
</section>
<section>
<h3>Reset CSS</h3>
<div>
Most elements:
<pre><code class = "html">
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
</code></pre>
</div>
<div>
Lists:
<pre><code class = "html">
list-style: none;
</code></pre>
</div>
</section>
<section>
<h3>Reset CSS</h3>
<p>We've done all the hard work for you! Instead of typing this out - we've included this in our example files.</p>
</section>
<section>
<h3>Standard widths and sizes</h3>
<ul>
<li>Screen sizes vary from computer to computer. Standardize your site on different screen sizes by defining specific widths.</li>
<li>Wrap your content in containers to control the max width it can span across a screen.</li>
<li>Keep in mind screen sizes also mean different font size display.</li>
<li>Retina screens have a higher pixel density and a larger resolution, so fonts appear smaller.</li>
</ul>
</section>
<section>
<h3>Fixed vs. Fluid Width pages</h3>
<p>
<strong class="blue">Fixed</strong>
</p>
<ul>
<li>Fixed websites have a set width for the wrapper, usually 960px to 1024px.</li>
<li>The elements inside the wrapper have a set width, or percentage of the wrapper width.</li>
<li>No matter the screensize, the user always sees the same size site.</li>
</ul>
</section>
<section>
<h3>Fixed vs. Fluid Width pages</h3>
<p>
<strong class="blue">Fluid</strong>
</p>
<ul>
<li>Also referred to as a liquid layout.</li>
<li>Majority of the components, including the wrapper, have percentages for their widths.</li>
<li>The layout adjusts for the width of the user's screen resolution.</li>
<li>Sounds like a responsive site right!? More on that later.</li>
</ul>
</section>
<section>
<h3>Containers</h3>
<p>Wrappers are a good way to center content if the screen width is wider than your content.</p>
<pre><code class = "html">
.container {
width: 100%; /* take up full viewport width */
max-width: 1400px; /* if viewport is larger than 1440px,
don't let it take up 100% */
margin: 0 auto; /* center content in the viewport */
}
</code></pre>
<ul>
<li>1. The container will take up 100% of the screen if the width of the viewport is less than 1440px.</li>
<li>2. If the viewport is wider than 1440px, it will reach it's max width, and become centered in the viewport.</li>
</ul>
</section>
<section data-background="#f05b62">
<h1 style="color: #fafafa;">HTML5</h1>
</section>
<section>
<h3>HTML 5: What is it?</h3>
<p>Formally, HTML5 is the <a href="http://www.w3.org/TR/html5/" target="_blank">W3C’s specification</a> for the next version of HTML.</p>
<p>Informally, people use "HTML5" to refer to a whole set of new web standards and abilities:
<ul class>
<li>HTML5</li>
<li>CSS3</li>
<li>JavaScript</li>
</ul>
</section>
<!-- Specifications-->
<section>
<h2>Quick History of HTML5</h2>
<ul>
<li>
<strong class="blue">2004:</strong>"WHAT" Working group formed. (WHATWG)
<br/>
<p>Members from Apple, Mozilla, & Opera set out to develop HTML5.</li>
<li class="fragment">
<strong class="blue">2008:</strong>First verson of HTML5 published</br>
<p>First draft is written, but changes are still coming. HTML5 is continually evolving.</p>
</li>
<li class="fragment">
<strong class="blue">2008:</strong>Firefox 3 becomes HTML5 compatable.</li>
<li class="fragment">
<strong class="blue">Jan. 2010:</strong>YouTube now offers HTML5 video player.</li>
</ul>
</section>
<section>
<h2>Okay, not that quick history of HTML5</h2>
<ul>
<li class="fragment">
<strong class="blue">April 2010:</strong> Steve Jobs trashes Flash & bans it on all Apple devices in favor of HTML5.</li>
<li class="fragment">
<strong class="blue">Dec. 2010:</strong> Chrome opens HTML5 web store.</li>
<li class="fragment">
<strong class="blue">Sept. 2011:</strong> 34% of top 100 sites use HTML5</li>
<li class="fragment">
<strong class="blue">Sept. 2012:</strong> WC3 proposes stable release of HTML5 by end of 2014!</li>
<li class="fragment">
<strong class="blue">Oct. 2014:</strong> Final and complete!</li>
</ul>
</section>
<!-- Browser compatibility -->
<aside class="notes">up-to-date-stats as of 7/2015</aside>
<section>
<h2>What about the browsers?</h2>
<p>Percentage of HTML5 Elements supported:</p>
<ul>
<li class="chrome">
<strong>Chrome 43:</strong>
<span class="green">95% supported</span>
</li>
<li class="opera">
<strong>Opera 29:</strong>
<span class="blue">94% supported</span>
</li>
<li class="firefox">
<strong>Firefox 38:</strong>
<span class="blue">84% supported</span>
</li>
<li class="webkit">
<strong>Safari 8:</strong>
<span class="blue">71% supported</span>
</li>
<li class="ie">
<strong>Internet Explorer 11:</strong>
<span class="blue">60% supported</span>
</li>
</ul>
</section>
<section>
<h3>So what's so cool about it?</h3>
<img src="images/html5.svg" style="width:25%" alt="" class="no-border" />
<p>Too much to cover in our time together</p>
<p>But here are some highlights:</p>
</section>
<section>
<h2>Marks some old things obsolete</h2>
<strong class="blue">Examples</strong>
<ul>
<li>Deprecated items (e.g.
<code>frame, frameset, noframes</code>)</li>
<li>Presentational elements and attributes replaced by CSS (e.g.
<code>font, big, center</code>)</li>
</ul>
<a href="http://dev.w3.org/html5/spec/single-page.html#obsolete" target="_blank">Reference</a>
</section>
<section>
<h2>Redefines a few things</h2>
<p>Gives some old elements semantic meaning and separates them from presentation (e.g.
<code>b, i, strong, em</code>)</p>
</section>
<!-- DOCTYPE -->
<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>
<!-- New Elements -->
<section>
<h2>New Structural Elements</h2>
</section>
<section>
<h2><section></h2>
<ul>
<li>Groups 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><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><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><article></h2>
<ul>
<li>Self-contained related content</li>
<li>E.g. blog posts, news stories, comments, reviews, forum posts</li>
</ul>
</section>
<section>
<h3>Let's Develop It</h3>
<ul>
<li>Use new HTML elements to layout the site</li>
<li>Refer to the example design for hints</li>
</ul>
</section>
<section data-background="#f05b62">
<h1 style="color: #fafafa;">Horizontal Fixed Nav</h1>
</section>
<section>
<h3>All the cool kids are doing it</h3>
<ul>
<li>Horizontal fixed-to-top nav allows users to have access to navigational elements at all times</li>
<li>All the rage these days</li>
<li>Be careful - screen heights vary, and it reduces the amount of content visible on smaller screens</li>
</ul>
</section>
<section>
<h3>Fixed Nav: HTML</h3>
<p>Let's include it in a header, since we know we'll be grouping related content here.</p>
<pre><code class="xml">
<header>
<nav>
<ul>
<li><a href="#home">My Home</a></li>
<li><a href="#diet">My Diet</a></li>
<li><a href="#pattern">Stripes</a></li>
</ul>
</nav>
</header>
</code></pre>
</section>
<section>
<h3>Fixed Nav: CSS</h3>
<p>Remember, using fixed position is like using absolute position, except that it's fixed to the viewport, not the containing element.</p>
<p>We also have to define a width for it, and its location.</p>
<pre><code class="css">
nav {
position: fixed;
top: 0;
left: 0;
background: #fafafa;
border-bottom: 2px solid #ccc;
height: 70px;
width: 100%;
}</code></pre>
</section>
<section>
<h3>Fixed Nav: CSS</h3>
<p>Because we've fixed the nav to the top of the viewport, we need to bump the content of the
<code>body</code> down to be visible to the user.</p>
<p>This should be the same, or more than, the height of the navigation bar.</p>
<pre><code class="css">
body {
padding-top: 70px;
}
nav {
position: fixed;
top: 0;
left: 0;
background: #fafafa;
border-bottom: 2px solid #ccc;
height: 70px;
width: 100%;
}</code></pre>
</section>
<section>
<h3>Fixed Nav: CSS</h3>
<p>Now we need to get those list items next to each other instead of stacked.</p>
<p>Let's float them to the left and add some padding to the links so they have a large clickable area.</p>
<pre><code class="css">nav {
position: fixed;
top: 0;
left: 0;
background: #fafafa;
border-bottom: 2px solid #ccc;
height: 70px;
width: 100%;
}
nav li {
float: left;
width: auto;
}
nav li a {
padding: 25px 10px;
display: block;
}
</code></pre>
</section>
<section>
<h3>Fixed Nav: Adding a brand</h3>
<p>We can use an
<code>H1</code> with text replacement to include a brand, or logo, in the corner that will still work if images are turned off, making it accesible to screen readers.</p>
<pre><code class="xml">
<header>
<nav>
<h1 id="brand">IMA Zebra</h1>
<ul>
<li><a href="#home">My Home</a></li>
<li><a href="#diet">My Diet</a></li>
<li><a href="#pattern">Stripes</a></li>
</ul>
</nav>
</header>
</code></pre>
</section>
<section>
<h3>Fixed Nav: Text replacement & H1s</h3>
<pre><code class="css">#brand {
color: transparent;
background: url(../images/z.png) no-repeat top left;
height: 60px;
width: 60px;
float: left;
margin: 5px;
}
nav ul {
float: right;
width: auto;
} </code></pre>
</section>
<section>
<h3>Why Text Replacement?</h3>
<ul>
<li>If we turn the CSS off for this page - the title will still be visible to the browser.</li>
<li>If a user is coming to our site with a screen reader - the title of the site will be readable to them</li>
<li>Search engines ♥ it!</li>
</ul>
</section>
<section>
<h3>Fixed Nav: Container</h3>
<p>Notice how the edge of the nav bumps up against the edge of the browser? Let's fix that by adding a container around it.</p>
<pre><code class="xml">
<header>
<nav>
<div class="container">
<h1 id="brand">IMA Zebra</h1>
<ul>
<li><a href="#home">My Home</a></li>
<li><a href="#diet">My Diet</a></li>
<li><a href="#pattern">Stripes</a></li>
</ul>
</div>
</nav>
</header>
</code></pre>
</section>
<section>
<h3>Fixed Nav: Container</h3>
<p>Let's give the container a fixed width and see what happens.</p>
<pre><code class="css">.container {
width: 1024px;
margin: 0 auto;
}</code></pre>
<p>Now wherever we use
<code>.container</code> it will be 1024px wide and centered.</p>
</section>
<section>
<aside class="notes">End of Class 1 in 4 week sequence</aside>
<h3>Develop It!</h3>
<p>Let's make some small tweaks to the navigation
<ul>
<li>Remove the underlines on the links with
<code>text-decoration</code>
</li>
<li>Change the color of the links</li>
<li>Try adding a background color on hover</li>
</ul>
</section>
<section data-background="#f05b62">
<h1 style="color: #fafafa;">Hero Section</h1>
</section>
<section>
<h3>What is a Hero?</h3>
<ul>
<li>Large banner image, prominently placed on a web page, generally in the front and center</li>
<li>First visual a visitor encounters on the site and its purpose is to present an overview of the site's most important content</li>
<li>Often consists of image and text, can be static or dynamic</li>
</ul>
</section>
<section>
<section>
<h2>Hero Examples</h2>
</section>
<section>
<img src="images/apple.png" />
</section>
<section>
<img src="images/uber.png" />
</section>
<section>
<img src="images/fostr.png" />
</section>
<section>
<img src="images/ndesign.png" />
</section>
<section>
<img src="images/karma.png" />
</section>
</section>
<section>
<h3>Hero: HTML</h3>
<p>Our Hero
<code>section</code> should look a little something like this:</p>
<pre><code class="xml"><section id="hero">
<img src="images/zebra.jpg" alt="IMA Zebra" />
<h2>IMA Zebra</h2>
<span class="city">Africa</span>
</section> </code></pre>
</section>
<section>
<h3>Hero: CSS</h3>
<p>Now is where the fun really happens!</p>
<pre><code class="css">#hero {
background: url(../images/zebra-hero.jpg) no-repeat top left;
color: #fafafa;
text-align: center;
}
</code></pre>
</section>
<section>
<h3>Hero: CSS</h3>
<p>Let's give it a height and some padding too.</p>
<pre><code class="css">#hero {
background: url(../images/zebra.jpg) no-repeat top left;
color: #fafafa;
text-align: center;
height: 350px;
padding: 25px 0;
}
</code></pre>
<p>Remember our Box Model. Padding adds to the height & width of elements.</p>
<p>So the height of our hero will be
<code>400px</code>
</p>
</section>
<section>
<h3>Well, that was unexpected...</h3>
<p>Things that are wrong with this hero right now:
<ol>
<li>That image of your face is way to big! And it's not even a circle!</li>
<li>The background image is way too large</li>
<li>The headline is really tiny</li>
</ol>
</section>
<section>
<h3>Hero: Profile Image</h3>
<p>Let's make the profile image a little smaller.</p>
<p>We'll use CSS Targeting with the descendant selector to style the image.</p>
<pre><code class="css">#hero img {
width: 150px;
}</code></pre>
<p>That should do it</p>
</section>
<section data-background="#f05b62">
<h1 style="color: #fafafa;">Border Magic</h1>
</section>
<section>
<h3>Turning squares into circles with magic!</h3>
<p>Okay, it's not really magic, it's just a bit of CSS3.</p>
</section>
<section>
<h3>Border-Radius</h3>
<p>Simply put, allows you to create rounded corners on boxes.</p>
<p>Designers rejoice!</p>
</section>
<section>
<h3>Border-radius</h3>
<p>20px radius on all corners</p>
<pre><code class="css">#hero img {
border-radius: 20px;
}</code></pre>
<img src="images/radius-20.png" />
</section>
<section>
<h3>Border-radius</h3>
<p>10px radius on top left & bottom right</p>
<p>40px on top right & bottom left</p>
<pre><code class="css">#hero img {
border-radius: 10px 40px;
}</code></pre>
<img src="images/radius-10-40.png" />
</section>
<section>
<h3>Border-radius</h3>
<p>10px radius on top left</p>
<p>20px radius top right</p>
<p>40px radius bottom right</p>
<p>80px radius bottom left</p>
<pre><code class="css">#hero img {
border-radius: 10px 20px 40px 80px;
}</code></pre>
<img src="images/radius-10-20-40-80.png" />
</section>
<section>
<h3>Border-radius</h3>
<p>50% radius on all corners</p>
<pre><code class="css">#hero img {
border-radius: 50%;
}</code></pre>
<img src="images/radius-50.png" />
</section>
<section data-background="#f05b62">
<h1 style="color: #fafafa;">Vendor Prefixes</h1>
</section>
<section>
<h3>Vendor Prefixes</h3>
<p>HTML5 and CSS3 are still new!</p>
<p>This is great, but it means that not all browsers treat new CSS3 properties the same</p>
</section>
<section>
<h3>Vendor Prefixes</h3>
<p>Flags it as a work-in-progress</p>
<p>When finished, the browser should support the non-prefixed name</p>
</section>
<section>
<h3>Vendor Prefixes</h3>
<p>Each browser has their own:</p>
<ul>
<li>
<span class="green">Chrome:</span>-webkit-</li>
<li>
<span class="green">Firefox:</span>-moz-</li>
<li>
<span class="green">Safari:</span>-webkit-</li>
<li>
<span class="green">Opera:</span>-o-</li>
</ul>
</section>
<section>
<h3>Using Prefixes</h3>
<pre><code class="css">#hero img {
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
-ms-border-radius: 50%;
-o-border-radius: 50%;
border-radius: 50%;
}</code></pre>
<p>Order matters! The non-prefixed version should always go last.</p>
</section>
<section>
<h3>NOTE:</h3>
<p>While you should always use the vendor prefixes when writing code, today we're just going to use the non-prefixed property.</p>
<p>This is to save time during the code exercises</p>
</section>
<section data-background="#f05b62">
<h1 style="color: #fafafa;">Back to our Hero!</h1>
</section>
<section>
<h3>Background-size</h3>
<p>Notice how the image is too large for the section? Let's fix that with a new property called
<code>background-size</code>
</p>
<pre><code class="css">#hero {
background: url(../images/zebra.jpg) no-repeat top left;
color: #fafafa;
text-align: center;
height: 350px;
padding: 25px 0;
background-size: cover;
}
</code></pre>
<p>
<code>cover</code> scales the image to the largest size such that both its width and its height can fit inside the content area.</p>
</section>
<section>
<h3>Develop It!</h3>
<p>Let's make some small tweaks to the Hero
<ul>
<li>Move the image down from the top</li>
<li>Adjust the font size of the header</li>
<li>Add a border to the span</li>
</ul>
</section>
<section data-background="#f05b62">
<h1 style="color: #fafafa;">3-column Content Area</h1>
</section>
<section>
<h3>Why 3 columns?</h3>
<p>Because 2 columns is so 2013</p>
<p>Or, because it's a comfortable width for readability. And because 3 is a pleasing design construct.</p>
</section>
<section>
<h3>3 Column: HTML</h3>
<p>Our code should look something like this:</p>
<pre><code class="xml"><section id="main-content">
<h3>...</h3>
<section class="column">
<img src="images/africa.png" alt="Africa">
<h4>My Home</h4>
<p>Wild zebras live in Africa.</p>
<a href="home.html" class="btn">See my home</a>
</section>
<!-- Repeat .column x3 -->
</section> </code></pre>
</section>
<section>
<h3>3 Column: CSS</h3>
<p>Now that we have our 3 columns, we want them to appear next to each other. We can do this by floating them all left.</p>
<pre><code class="css">.column {
float: left;
width: 30%;
padding: 15px;
} </code></pre>
<p>We used 30%, because it lets us perfectly spaced columns without doing math! Don't forget padding (or margin) to give the columns some space.</p>
</section>
<section>
<h3>Wow. Large Images.</h3>
<p>The images didn't scale with the columns, because they ignore constraints like
<code>div</code> width, unless you tell them to do so.</p>
<pre><code class="css">.column img {
width: 90%;
max-width: 90%;
}</code></pre>
<p>There we go!</p>
<p>Let's add a border radius to it too, because we ♥ circles</p>
<pre><code class="css">.column img {
width: 90%;
max-width: 90%;
border-radius: 50%;
}</code></pre>
</section>
<section>
<h3>3 Column: Container</h3>
<p>We've got our 3 column layout set, our images are scaled based on the width of the column, but our columns are still bumping against the edges of the browser.</p>
<pre><code class="xml"><section id="main-content">
<div class="container">
<h3>...</h3>
<section class="column">
...
</section>
<section class="column">
...
</section>
<section class="column">
...
</section>
</div>
</section></code></pre>
<p>Adding the container, which we already defined the width of, makes everything line up.</p>
</section>
<section>
<aside class="notes">End of Class 2 in 4 week sequence</aside>
<h3>Develop It!</h3>
<p>Let's make some small tweaks to these columns
<ul>
<li>Adjust the font size of the main header of the content area</li>
<li>Adjust the font size of the headers in the columns - try changing their colors too</li>
<li>Add a border to the images to make them stand out a bit more</li>
</ul>
</section>
<section data-background="#f05b62">
<h1 style="color: #fafafa;">SVG Graphics</h1>
</section>
<section>
<h2>SVG Graphics</h2>
<p>Designers everywhere have always wanted to use vector based graphics on their sites because of their quality.</p>
<p>Well now you can!</p>
</section>
<section>
<h2>It's not that new really</h2>
<p>It's been a W3C (World Wide Web Consortium) standard since 1999</p>
<p>In recent years browsers are becoming more and more compatable with SVG graphics.</p>
<p>Once upon a time, .png graphics weren't supported in browsers, soon the world will know about SVG!</p>
</section>
<section>
<h2>How to use SVG today</h2>
<p>Use Adobe Illustrator, or other vector program, to create a high quality image.</p>
<p>Save it as a .svg file.</p>
<p>Save a high res .png image as a fallback.</p>
</section>
<section>
<h2>Include SVG</h2>
<p>Use SVG as an image:</p>
<pre><code><img src="image.svg" onerror="this.onerror=null; this.src='image.png'"></code></pre>
<p>Use SVG as a background image:</p>
<p class="blue">HTML:</p>
<pre><code><a href="/" class="logo">
GDI
</a></code></pre>
<p class="blue">CSS:</p>
<pre><code class="css">.logo {
display: block;
color: transparent;
width: 100px;
height: 82px;
background: url(kiwi.svg);
background-size: 100px 82px;
}</code></pre>
</section>
<section>
<h2>Browser Support</h2>
<p>Our favorite topic - Internet Explorer</p>
<img src="images/svg-support.png" alt="SVG support" />
<p>Chris Coyer has written an <a href="http://css-tricks.com/using-svg/" target="_blank">amazing article</a> with tons of work arounds for our BFF IE8.</p>
</section>
<section>
<h3>SVG Social Icons</h3>
<p>Now that we know how awesome SVG graphics are, let's use them in our social links section.</p>
</section>
<section>
<h3>Social Links: HTML</h3>
<pre><code class="html"><section id="social">
<ul>
<li>
<a href="..">
<img src="images/facebook.svg" alt="Facebook" />
</a>
</li>
<!-- Repeat for all social links you want to include -->
</ul>
</section>
</code></pre>
<p>We're using a list for these links for the exact same reason we used them in the navigation. They are a list of links, and should be marked up accordingly.</p>
</section>
<section>
<h3>Social Links: CSS</h3>
<p>We'll need to add a background, some padding, account for the floated list items.</p>
<pre><code class="css">#social {
background: #57BEC5;
color: #fafafa;
padding: 25px 0;
overflow: hidden;
}
#social li {
float: left;
width: auto;
padding: 20px;
}</code></pre>
</section>
<section>
<h3>Centering the List</h3>
<p>First we should put our social links in a container! We'll also add in a headline.</p>
<pre><code class="xml"><section id="social">
<div class="container">
<h3>...</h3>
<ul>
...
</ul>
</div>
</section></code></pre>
<p>Next we'll center the
<code>ul</code> with a very <a href="http://matthewjamestaylor.com/blog/beautiful-css-centered-menus-no-hacks-full-cross-browser-support" target="_blank">flexible technique</a> that will allow us to have a list of any width</p>
</section>
<section>
<h3>Develop It!</h3>
<ul>
<li>Style the headline using the Descendant Selector</li>
<li>If you have Illustrator or another program to modify .svg graphics, change the colors to match your site</li>
</ul>
</section>
<section data-background="#f05b62">
<h1 style="color: #fafafa;">@font-face</h1>
<h3 style="color: #fafafa;">Or really, the reason you took this class.</h3>
</section>
<section>
<h3>@font-face</h3>
<p>The world of HTML has progressed beyond Times New Roman and Arial</p>
<p class="green">Yay!</p>
<p>How do we use new and cool fonts?</p>
</section>
<section>
<h3>Class, meet Google Web Fonts</h3>
<p>Google has hundreds of free, open-source fonts that have been optimized for the web, and ready for us to use!</p>
<p>The service runs on Google's servers which are fast, reliable and tested. Google provides this service free of charge.</p>
</section>
<section data-background="#f05b62">
<h2 style="color: #fafafa;"><a href="http://www.google.com/fonts" style="color: #fafafa;" target="_blank">www.google.com/fonts</a>
</h2>
</section>
<!-- Fonts-->
<section>
<h3>@font-face</h3>
<p>In our example, we've used Lato for the body and Bree Serif for the headlines</p>
<p>You can use any font you'd like!</p>