-
Notifications
You must be signed in to change notification settings - Fork 83
/
part_08_backgrounds.html
973 lines (846 loc) · 35.4 KB
/
part_08_backgrounds.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
<!doctype html>
<html>
<head>
<!--[if gte IE 9]>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<![endif]-->
<!--[if lt IE 9]>
<meta http-equiv="X-UA-Compatible" content="IE=edge;chrome=1" />
<![endif]-->
<meta charset="utf-8" />
<title>Backgrounds and Borders: CSS: From Knowledgable to Ninja</title>
<link href='http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/screen.css" media="projection, screen"/>
<link rel="stylesheet" href="css/print.css" media="print"/>
<style>
.multiplebg {
background-image: -webkit-linear-gradient(#C7573A, #C7573A), -webkit-linear-gradient(#BDD9D5,#BDD9D5);
background-image: -moz-linear-gradient(#C7573A, #C7573A), -moz-linear-gradient(#BDD9D5,#BDD9D5);
background-image: -ms-linear-gradient(#C7573A, #C7573A), -ms-linear-gradient(#BDD9D5,#BDD9D5);
background-image: -o-linear-gradient(#C7573A, #C7573A), -o-linear-gradient(#BDD9D5,#BDD9D5);
background-image: linear-gradient(#C7573A, #C7573A), linear-gradient(#BDD9D5,#BDD9D5);
background-size: 100px 100px;
background-repeat: no-repeat;
background-position: 0 0, 20px 20px;
height:120px;
width: 120px;
float: right;
margin: 20px;
}
.bgimage {
background-image: -webkit-radial-gradient(50% 50%, circle closest-side, transparent 70%, #C7573A 70%,#C7573A 85%,transparent 85% );
background-image: -moz-radial-gradient(50% 50%, circle closest-side, transparent 70%, #C7573A 70%,#C7573A 85%,transparent 85% );
background-image: -ms-radial-gradient(50% 50%, circle closest-side, transparent 70%, #C7573A 70%,#C7573A 85%,transparent 85% );
background-image: -o-radial-gradient(50% 50%, circle closest-side, transparent 70%, #C7573A 70%,#C7573A 85%,transparent 85% );
background-image: radial-gradient(50% 50%, circle closest-side, transparent 70%, #C7573A 70%,#C7573A 85%,transparent 85% );
background-size: 95px 95px;
background-repeat: no-repeat;
background-position: 0 0;
}
#bgattachment {width:300px; height:300px; overflow:scroll; border: 1px solid #BDD9D5; float:right; top:0; left:0;}
.backgroundclip {
width: 150px;
height: 150px;
border: 20px dotted rgba(128, 128, 128, 0.8);
padding: 20px; margin: 20px;
background-color: #BDD9D5;
float:left;
text-align:center;
}
#bcksizeexample, #bcksizeexample2 {
background-repeat:repeat;
float: right;
box-shadow: inset 5px 5px 5px rgba(0,0,0,0.4),inset -5px -5px 5px rgba(0,0,0,0.4) ;
width: 200px;
height:400px;
text-align:center;
margin-left: 20px;
}
#bcksizeexample2 {
background-repeat: no-repeat;
width: 100px;
height:200px;
background-image:url(img/shark.gif);
background-position: 50%;
background-color: white;
}
.borderstyle dt {
border: 9px solid #C7573A;
margin-bottom:0; margin-top:0.2em;
display:block; width: 30%; padding-left: 7px;
}
.radius pre {float: left; width:70%;}
.radius b {
display: inline-block;
height:50px;
width: 50px;
border: 10px inset #C7573A;
float:left;
margin-left: 10px;
}
.whatisborderimage {
margin: auto;
height: 400px;
width: 400px;
background-image:
-webkit-linear-gradient(#C7573A 5px, transparent 5px, transparent 245px, #C7573A 245px),
-webkit-linear-gradient(left, #C7573A 5px, transparent 5px, transparent 245px, #C7573A 245px),
-webkit-linear-gradient(#BDD9D5, #C7573A, #BDD9D5);
background-image:
-moz-linear-gradient(#C7573A 5px, transparent 5px, transparent 245px, #C7573A 245px),
-moz-linear-gradient(left, #C7573A 5px, transparent 5px, transparent 245px, #C7573A 245px),
-moz-linear-gradient(#BDD9D5, #C7573A, #BDD9D5);
background-image:
-ms-linear-gradient(#C7573A 5px, transparent 5px, transparent 245px, #C7573A 245px),
-ms-linear-gradient(left, #C7573A 5px, transparent 5px, transparent 245px, #C7573A 245px),
-ms-linear-gradient(#BDD9D5, #C7573A, #BDD9D5);
background-image:
-o-linear-gradient(#C7573A 5px, transparent 5px, transparent 245px, #C7573A 245px),
-o-linear-gradient(left, #C7573A 5px, transparent 5px, transparent 245px, #C7573A 245px),
-o-linear-gradient(#BDD9D5, #C7573A, #BDD9D5);
background-size: 400px 250px, 250px 400px, 350px 350px;
background-position: center;
background-position: no-repeat;
}
/* Border-image */
#boderimage {
background-repeat:repeat;
width: 400px;
height:100px;
text-align:center;
margin-left: 20px;
border-width: 10px;
float:left;
-webkit-border-image: url(http://standardista.com/articles/gradient.png) 34 / 34px stretch;
-moz-border-image: url(http://standardista.com/articles/gradient.png) 34 / 34px stretch;
-ms-border-image: url(http://standardista.com/articles/gradient.png) 34 / 34px stretch;
-o-border-image: url(http://standardista.com/articles/gradient.png) 34 / 34px stretch;
border-image: url(http://standardista.com/articles/gradient.png) 34 / 34px stretch;
} [title="prefix"] {white-space:nowrap; display: block;}
tr {height: 2em;}
th {text-align: right; padding-right: 10px;}
</style>
</head>
<body>
<header>
<nav>
<ul>
<li class="button cancel" id="back">Back</li>
<li class="button done" id="next">Next</li>
</ul>
</nav>
</header>
<div id="info">
<p>
<span class="key">→</span> and <span class="key">→</span> to change slides.
<span class="key">2</span> for comments. <a href="http://estelle.github.com/CSS-Workshop">estelle.github.com/CSS-Workshop</a>
</p>
</div>
<div id="presentation">
<div id="presentation-counter"></div>
<div id="slides">
<div class="slide normal">
<header>
<h1 style="font-size:200%;">CSS: from Knowledgable to Ninja</h1>
</header>
<section class="content">
<p> ◈ Estelle Weyl</p>
<p> ◈ <a href="http://www.twitter.com/estellevw">@estellevw</a></p><p> ◈ <a href="http://www.standardista.com">www.standardista.com</a></p>
</section>
</div>
<!-- OUTLINE -->
<div class="slide normal">
<header><h1>Course Outline</h1></header>
<section class="content">
<ol><li><a href="../selectors/">Selectors</a></li>
<li><a href="part_02_specificity.html">Specificity</a></li>
<li><a href="part_03_generated.html">Generated Content</a></li>
<li><a href="part_04_media.html">Media Queries</a></li>
<li><a href="part_04_media.html#slide10">Debugging</a></li>
<li><a href="part_06_colors.html">Colors & Transparency </a></li>
<li><a href="part_07_fonts.html">Fonts / Typography </a></li>
<li><a href="part_08_backgrounds.html">Backgrounds & Borders </a></li>
<li><a href="../gradients/">Gradients</a></li>
<li><a href="part_10_transforms.html">Transforms</a></li>
<li><a href="../animation/">Transitions & Animation</a></li>
<li><a href="part_12_features.html">Other Features</a></li>
</ol>
</section>
</div>
<div class="slide intro">
<header><h1>Part 8: Backgrounds and Borders</h1></header>
</div>
<div class="slide normal">
<header><h1>Backgrounds and Borders</h1></header>
<section class="content">
<ul style="float: left; width:45%;">
<li>Background properties
<ul>
<li>background-color</li>
<li>background-image'</li>
<li>background-repeat</li>
<li>background-attachment</li>
<li>background-position</li>
<li>background-clip</li>
<li>background-origin</li>
<li>background-size</li>
<li>background shorthand</li>
</ul>
</li>
</ul>
<ul style="float: left; overflow:hidden; width: 45%;">
<li>Border properties
<ul>
<li>border-color</li>
<li>border-style</li>
<li>border-width</li>
<li>border shorthand</li>
<li>border-radius </li>
</ul>
</li>
<li>Border Images
<ul>
<li>border-image-source</li>
<li>border-image-slice</li>
<li>border-image-width</li>
<li>border-image-outset</li>
<li>border-image-repea</li>
<li>border-image shorthand</li>
</ul>
</li>
</ul>
</section>
</div>
<!-- SECTION: Background -->
<div class="slide intro">
<header><h1>Background properties</h1></header>
</div>
<!--background-color -->
<div class="slide normal">
<header><h1>background-color</h1></header>
<section class="content">
<ul>
<li>Use any of the color types</li>
<li>Always declare when declaring background images</li>
<li>Declare only once in a shorthand declaration.</li>
<li>Nothing really new here</li>
</ul>
<pre contenteditable> background-color: white;
background-color: #fff;
background-color: #FFFFFF;
background-color: rgb(255,255,255);
background-color: rgb(100%,100%,100%);
background-color: rgba(255,255,255,1);
background-color: rgba(100%,100%,100%, 1);
background-color: hsl(0, 100%, 100%);
background-color: hsla(0, 100%, 100%, 1);
background-color: <span class="imp">transparent</span>;
background-color: currentColor;</pre>
<p>Confused? See <a href="part_06_colors.html">Part 6: Colors & Transparency</a></p>
</section>
</div>
<!-- bacgkround image -->
<div class="slide normal">
<header><h1>Old School: background-image</h1></header>
<section class="content">
<pre contenteditable><em>none | <url> | inherit</em> </pre>
</pre><pre style="line-height:2;">background-image: url(path/aSingleLonelyCat);</pre>
<ul>
<li>background-color</li>
<li>background-image</li>
<li>background-repeat</li>
<li>background-attachment</li>
<li>background-position</li>
</ul>
</section>
</div>
<!--background-image -->
<div class="slide normal">
<header><h1>multiple background-image</h1></header>
<section class="content">
<pre contenteditable>background-image: url(brown.gif), url(blue.gif);</pre>
<div class="multiplebg"></div>
<ul>
<li>Comma separated</li>
<li>layered front to back</li>
<li>Include background-color</li>
<li>Don't print</li>
<li>Not accessible</li>
</ul>
<ul class="icons" style="clear: both;">
<li class="chrome">Chrome</li>
<li class="safari">Safari 1.3</li>
<li class="firefox">Firefox 3.6</li>
<li class="opera">Opera</li>
<li class="ie ">IE 9</li>
</ul>
</section>
</div>
<!-- bacgkround image -->
<div class="slide normal">
<header><h1>CSS3 background-image value types</h1></header>
<section class="content">
<pre contenteditable><em>none | <url></em> | <em><image-list></em> | <em><element-reference></em> | <em><gradient></em></pre><pre style="line-height:2;">url(singleImage.png)
url(multipleImages.gif), url(otherGif.gif)
none
linear-gradient(top, red, blue)
radial-gradient(circle, red, blue)
url(data:image/gif;base64,fOulrS123hEAAa517sdfQfda...)
url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='200'><circle cx='55' cy='190' r='25' fill='#FFF' /></svg>");
element('#someID')
image('ico_sprite.jpg#xywh=32,64,16,16')
image("try1.svg", 'try2.png' , "try3.gif")
image("leftArrow.png" ltr, "rightArrow.png" rtl)</pre>
</section>
</div>
<div class="slide normal">
<header><h1>url() values</h1></header>
<section class="content">
<pre style="line-height:1; white-space:pre-wrap; word-break:break-all">url(singleImage.png)
url(multipleImages.gif), url(otherGif.gif)
url(SVGImages.<strong>svg</strong>);
url(sprite.png<strong>#xywh=40,0,20,20</strong>)
url(<strong>data:</strong>image/gif;<strong>base64</strong>,fOulrS123hEAAa517sdfQfdafsPFRjuy187xxRM221...)
url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='200'><circle cx='55' cy='190' r='25' fill='#FFF' />^lt;path d='M160 213h-34a82 82 0 0 0 -82 -82v-34a116 116 0 0 1 116 116z' fill='#666'/><path d='M184 213A140 140 0 0 0 44 73 V 38a175 175 0 0 1 175 175z' fill='#666'/></svg>"); <a href="http://jsfiddle.net/estelle/sTd62/embedded/result/" target="play">SVG Example</a>
</pre>
<p>Media fragment will not break backwards... hash will be ignored</p>
</section>
</div>
<div class="slide normal">
<header><h1>Other background-image syntax</h1></header>
<section class="content">
<p>Allows the use of any element, including <canvas> where images can be used.</p>
<ul class="icons" style="float:right;"><li class="firefox">Firefox 4</li>
</ul><pre contenteditable>background-image: -moz-element('#someID');
background-image: element('#someID')</pre>
<p>Define which portion of the image to show:</p>
<ul class="icons" style="float:right;">
<li class="firefox">Firefox 4</li>
</ul><pre contenteditable>background-image:
-moz-image-rect(url(ico_sprite.jpg), 32, 64, 16, 16);
background-image: image('ico_sprite.jpg#xywh=32,64,16,16')</pre>
</section></div>
<div class="slide normal">
<header><h1>Unsupported Syntax (future!!)</h1></header>
<section class="content">
<p>Fallback in case your images doesn't load:</p>
<pre contenteditable>background-image:
image("try1.svg", "try2.png", "try3.gif", blue)</pre>
<p>Flip the image if the direction is rtl.</p>
<pre contenteditable>background-image: image("arrow.png" rtl)</pre>
</section>
</div>
<!--background-image -->
<div class="slide normal">
<header><h1>background-image</h1></header>
<section class="content">
<pre contenteditable style="overflow: auto;"><strong>background-image:</strong> url(myGif.gif), url(otherGif.gif);
<strong>background-image:</strong> none;
<strong>background-image:</strong> linear-gradient(top, red, blue);
<strong>background-image: </strong>url(data:image/gif;base64,fOulrShEAAQ...);
<strong>background-image:</strong>
url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='200'><circle cx='55' cy='190' r='25' fill='#FFF' /></svg>");
<strong>background-image:</strong> element('#myID');
<strong>background-image:</strong> image('ico_sprite.jpg#xywh=32,64,16,16');
<strong>background-image:</strong> image("try1.svg", 'try2.png' , "try3.gif");</pre>
</pre>
</section>
</div>
<div class="slide normal">
<header><h1>Browser Support</h1></header>
<section class="content">
<table class="fontfamily" cellspacing="0"><thead class="icons">
<tr>
<th>Feature</th>
<th><span style="float: left; padding-top:20px;">/ Browser</span> <span class="firefox browser">Firefox</span></th>
<th><span class="chrome browser">Chrome</span></th>
<th><span class="ie browser">Internet Explorer</span></th>
<th><span class="opera browser">Opera</span></th>
<th><span class="safari browser">Safari</span></th>
</tr></thead>
<tbody> <tr>
<th>Basic support</th>
<td>1</td>
<td>1</td>
<td>4</td>
<td>3.5</td>
<td>1</td>
</tr>
<tr>
<th>Multiple backgrounds</th>
<td>3.6</td>
<td>1</td>
<td>9</td>
<td>yes</td>
<td>1.3</td>
</tr>
<tr>
<th>Gradients (prefixed)</th>
<td>3.6</td>
<td>1</td>
<td></td>
<td>11+ </td>
<td>4</td>
</tr>
<tr>
<th>Gradients</th>
<td>16</td>
<td>10</td>
<td>26</td>
<td>12.1</td>
<td>6.1</td>
</tr>
<tr>
<th>SVG images</th>
<td>4</td>
<td>8</td>
<td>9</td>
<td>9.5</td>
<td>5</td>
</tr>
<tr>
<th>element()</th>
<td> <span title="prefix">-moz</span></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<th>image()</th>
<td><span title="prefix">-moz-image-rect()</span></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</tbody>
</tbody>
</table>
</section>
</div>
<!-- background-repeat-->
<div class="slide normal bgimage" id="bgrepeat">
<header><h1>background-repeat</h1></header>
<section class="content">
<pre contenteditable>background-repeat:
<span class="imp">repeat</span> | repeat-x | repeat-y | no-repeat | space | round;</pre>
<dl class="deprecated listed">
<dt>repeat</dt>
<dd>Tiled as often as needed to cover background</dd>
<dt>no-repeat</dt>
<dd>Placed once, not tiled or repeated</dd>
<dt>repeat-x</dt>
<dd>Tiled along X axis only (Equivalent to repeat no-repeat)</dd>
<dt>repeat-y</dt>
<dd>Tiled along Y axis only (Equivalent to no-repeat repeat)</dd>
<dt>space</dt>
<dd>Repeated as often as will fit without being clipped, spaced out evenly</dd>
<dt>round</dt>
<dd>Repeated as often as will fit without being clipped then scaled so no space in between</dd>
</dl>
<pre contenteditable>background-repeat: <b><span id="txt_bgrepeat">no-repeat</span></b>; <select id="cmd_bgrepeat" onChange="fnc_bgrepeat(this);">
<option>no-repeat</option>
<option>repeat</option>
<option>repeat-x</option>
<option>repeat-y</option>
<option>space</option>
<option>round</option>
</select></pre>
<p style="font-size: 90%;">Should accept 2 values (H & V)<br>
Tip: Include <code>background-repeat: no-repeat;</code> in your reset CSS</p>
<script defer>
function fnc_bgrepeat(event) {
var backsize = event.value;
var slide = document.getElementById('bgrepeat');
slide.style.backgroundRepeat = event.value;
document.getElementById('txt_bgrepeat').innerHTML = event.value;
}
</script>
</section>
</div>
<!-- background-attachment -->
<div class="slide normal">
<header><h1>background-attachment</h1></header>
<section class="content">
<pre contenteditable>background-attachment: fixed | local | <span class="imp">scroll</span></pre>
<pre contenteditable>background-attachment: <b><span id="txt_bgattachment">scroll</span></b></pre>
<div class="bgimage" id="bgattachment">
<p>Filet mignon kielbasa pork chop short ribs short loin shank hamburger. Bresaola hamburger venison shankle pork andouille. Pastrami venison andouille pancetta sausage chicken biltong. Tri-tip jerky short loin tenderloin pork chop. Shoulder frankfurter turkey ribeye, jowl tail leberkase brisket sausage boudin ham hock shankle ground round short loin.
<!--<p>Bresaola ball tip meatball capicola beef ribs chicken. Pork tri-tip turkey bresaola shank. Strip steak sirloin cow pork, ribeye chicken short loin capicola jerky chuck. Shank ham hock rump strip steak, pork chop t-bone pork kielbasa beef andouille ham shankle pancetta. Flank cow strip steak, boudin pork loin chicken tri-tip leberkase meatloaf tail pig beef ribs turkey t-bone.
</p><p>
Short ribs shoulder turkey tenderloin. Ball tip ham capicola, turkey jowl ribeye fatback bacon pork chop t-bone drumstick boudin spare ribs tail jerky. Pastrami ham beef ribs, frankfurter filet mignon chicken ground round salami tri-tip shoulder turkey rump meatball hamburger cow. Sausage jowl shank, beef ribs bresaola fatback brisket ham hock chuck pork loin ribeye shankle spare ribs kielbasa. Pork shoulder ham hock ham, chicken pastrami venison drumstick ball tip turducken t-bone frankfurter.</p>
--> </div>
<div style="position:absolute;top:10px; right:10px;"><select id="cmd_bgattachment" onChange="fnc_bgattachment(this);">
<option>scroll</option>
<option>fixed</option>
<option>local</option>
</select>
<select onChange="document.getElementById('bgattachment').style.position = this.value;">
<option value="static">Default</option>
<option value="absolute">Move Me</option>
</select>
</div></section>
<script defer>
function fnc_bgattachment(event) {
var attachment = event.value;
var slide = document.getElementById('bgattachment');
slide.style.backgroundAttachment = event.value;
document.getElementById('txt_bgattachment').innerHTML = event.value;
}
</script>
</div>
<!--background-position -->
<div class="slide object">
<header><h1>% based background-position (old )</h1></header>
<object data="files/80_bgposition.html"></object>
<a href="files/80_bgposition.html" target="play" class="objectlink">Try it out</a>
</div>
<!--background-position -->
<div class="slide normal bgimage" style="background-position: right 150px bottom 50px;">
<header><h1>background-position</h1></header>
<section class="content">
<p>New in CSS3: Positioning relative to any corner</p>
<pre contenteditable>background-position: right 50px bottom 50px;</pre>
</ul>
<ul class="icons" style="clear: both;">
<li class="chrome">Chrome 25</li>
<li class="safari">Safari 6</li>
<li class="firefox">Firefox 13</li>
<li class="opera">Opera 10.5</li>
<li class="ie">IE 9</li>
</ul>
</section>
</div>
<div class="slide object">
<header><h1>4-value background-position</h1></header>
<object data="files/81_bgposition.html"></object>
<a href="files/81_bgposition.html" target="play" class="objectlink">Try it out</a>
</div>
<!--background-clip -->
<div class="slide" id="bgclip">
<header><h1>background-clip</h1></header>
<section class="content">
<pre contenteditable><b><u></u>background-clip</b>: <span class="imp">border-box</span> | padding-box | content-box</pre>
<div style="background-clip: content-box;" class="backgroundclip bgimage">content-box</div>
<div style="background-clip: padding-box;" class="backgroundclip bgimage">padding-box</div>
<div style="background-clip: border-box;" class="backgroundclip bgimage">border-box</div>
<ul class="icons">
<li class="chrome">Chrome</li>
<li class="safari"><span onClick="vendorPrefix('r', 'bgsize')">Safari</span></li>
<li class="firefox">Firefox 4</li>
<li class="opera">Opera</li>
<li class="ie ">IE 9</li>
<li class="txt">add <span onClick="vendorPrefix('m', 'bgclip')">-moz-</span> for FF 3.6 and earlier</li>
</ul>
</section>
</div>
<!--background-origin -->
<div class="slide" id="bgorigin">
<header><h1>background-origin</h1></header>
<section class="content">
<pre contenteditable><b><u></u>background-origin</b>: border-box | <span class="imp">padding-box</span> | content-box</pre>
<div style="background-origin: content-box;" class="backgroundclip bgimage">content-box</div>
<div style="background-origin: padding-box;" class="backgroundclip bgimage">padding-box</div>
<div style="background-origin: border-box;" class="backgroundclip bgimage">border-box</div>
<ul class="icons">
<li class="chrome"><span onClick="vendorPrefix('r', 'bgorigin')">Chrome</span></li>
<li class="safari">Safari 5.1</li>
<li class="firefox">Firefox 4</li>
<li class="opera">Opera</li>
<li class="ie ">IE 9</li>
<li class="txt">add <span onClick="vendorPrefix('m', 'bgorigin')">-moz-</span> for FF 3.6, <span onClick="vendorPrefix('w', 'bgorigin')">-webkit-</span> for Safari 5</li>
</ul>
</section>
</div>
<div class="slide object">
<header><h1>background-clip / background-origin</h1></header>
<object data="files/81b_bgposition.html"></object>
<a href="files/81b_bgposition.html" target="play" class="objectlink">Try it out</a>
</div>
<!--background-size -->
<div class="slide" id="bgsize">
<header><h1>background-size</h1></header>
<section class="content">
<pre contenteditable><b><u></u>background-size</b>: <span class="imp">auto</span> | contain | cover | <span id="actualsize"><length></span></pre>
<div id="bcksizeexample" class="bgimage">
<input type="range" min="3" max="30" step="1" value="15" id="bcksizechange" onChange="changeBackSide(this)" style="position:relative; top: -30px;"/>
</div><ul>
<li>Use for creating gradients backgrounds</li>
<li>Needed for hiDPI images</li>
<li>‘contain’ grows/shrinks to fully fit</li>
<li>‘cover’ grows to min size that covers 100% of height & width</li>
</ul>
<ul class="icons">
<li class="chrome">Chrome</li>
<li class="safari"><span onClick="vendorPrefix('r', 'bgsize')">Safari</span></li>
<li class="firefox">Firefox 4</li>
<li class="opera">Opera 11</li>
<li class="ie ">IE 9</li>
<li class="txt">add <span onClick="vendorPrefix('m', 'bgsize')">-moz-</span> for FF 3.6 and earlier</li>
</ul>
</section>
<script defer>
function changeBackSide(event) {
var backsize = event.value;
var image = document.getElementById('bcksizeexample');
image.style.backgroundSize = backsize + "px " + backsize + "px, " + backsize + "px " + backsize + "px, 100% 100%" ;
document.getElementById('actualsize').innerHTML = "<b>"+ backsize +"px " + backsize +"px</b>;";
}
</script>
</div>
<!--background-size -->
<div class="slide" id="bgsize">
<header><h1>background-size</h1></header>
<section class="content">
<pre contenteditable><b><u></u>background-size</b>: <span onClick="changeBackSide2('auto')">auto</span> | <span onClick="changeBackSide2('contain')">contain</span> | <span onClick="changeBackSide2('cover')">cover</span> | <span onClick="changeBackSide2('100px 200px')">100px 200px</span></pre>
<div id="bcksizeexample2" class="bgimage2">
</div>
</section>
<script defer>
function changeBackSide2(backsize) {
console.log('hit');
var image = document.getElementById('bcksizeexample2');
image.style.backgroundSize = backsize;
}
</script>
</div>
<!-- background shorthand-->
<div class="slide">
<header><h1>background shorthand</h1></header>
<section class="content">
<pre contenteditable>background:
img position / size repeat attachment origin clip,
img position / size repeat attachment box{1,2} bgcolor; </pre>
<pre contenteditable>background:
url(topImg.jpg) 0 0 / 30px 30px repeat scroll border-box content-box,
url(botImg.jpg) 15px 15px / 30px 30px fixed border-box #609;</pre>
<h1>DO NOT USE BACKGROUND SHORTHAND!!!</h1>
<ul>
<li><a href="http://www.standardista.com/css3/css3-background-properties">Border properties & browser support</a></li>
<li class="notes">If one ‘box’ value is present then it sets both 'background-origin' and 'background-clip' to that value. If two values are present, then the first sets 'background-origin' and the second 'background-clip'</li>
</ul>
</section>
</div>
<!--Border properties -->
<div class="slide intro">
<header><h1>Border properties</h1></header>
</div>
<!--border-color -->
<div class="slide normal">
<header><h1>border-color</h1></header>
<section class="content">
<ul>
<li>Use any of the color types</li>
<li>Nothing really new here</li>
</ul>
<pre contenteditable> border-color: white;
border-color: #fff;
border-color: #FFFFFF;
border-color: rgb(255,255,255);
border-color: rgb(100%,100%,100%);
border-color: rgba(255,255,255,1);
border-color: rgba(100%,100%,100%, 1);
border-color: hsl(0, 100%, 100%);
border-color: hsla(0, 100%, 100%, 1);
border-color: transparent;
border-color: <span class="imp">currentColor</span>; /* default */</pre>
</section>
</div>
<!--border-style -->
<div class="slide normal borderstyle">
<header><h1>border-style</h1></header>
<section class="content">
<div style="position: absolute; right: 0; width: 50%;">
<ul>
<li>Up to 4 values (TRouBLe)</li>
<li> Old Webkit browsers ignored color for groove, inset, outset & ridge. Fixed!</li>
<li>IE6 & IE7 do not understand 'hidden', and inherit.</li>
</ul>
</div>
<dl class="deprecated">
<dt style="border-style:none;" class="imp">none</dt>
<dd style="width: 50%">No border. As if border-width: 0; except with border-image</dd>
<dt style="border-style: hidden;">hidden</dt>
<dd style="width: 50%">Same as none, but relevant in border-collapsed tables</dd>
<dt style="border-style:dotted;">dotted</dt>
<dd> Round dots.</dd>
<dt style="border-style:dashed;">dashed</dt>
<dd>Square-ended dashes.</dd>
<dt style="border-style:solid;">solid</dt>
<dd>a single solid line.</dd>
<dt style="border-style:double;">double</dt>
<dd>Two parallel solid lines. Only relevant if border-width >= 3px. line + space + line = border-width value. </dd>
<dt style="border-style:groove;">groove</dt>
<dd>Shadow effect using two colors on each side, with a slightly lighter and darker than the border-color value. Top / left half of each side darker.</dd>
<dt style="border-style:ridge;">ridge</dt>
<dd>Looks as if it were coming out of the canvas. Bottom / Right darker</dd>
<dt style="border-style:inset;">inset</dt>
<dd>Looks sunken into page. Top and left border are made darker, bottom and right are lighter.. Treated as ridge in border-collapsed tables.</dd>
<dt style="border-style:outset;">outset</dt>
<dd>Looks as if popping out of page. Bottom and right are darker. Top and left border are lighter.. Treated as groove in border-collapsed tables. </dd>
</dl>
</section>
</div>
<!-- border-width-->
<div class="slide normal">
<header><h1>border-width</h1></header>
<section class="content">
<pre contenteditable>border-width: (length) | thin | <span class="imp">medium</span> | thick | inherit {1,4};</pre>
<ul>
<li>Up to 4 values (TRouBLe)</li>
<li>Nothing new here</li>
</ul>
</section>
</div>
<!-- border shorthand-->
<div class="slide normal">
<header><h1>border shorthand</h1></header>
<section class="content">
<pre contenteditable>border: width style color;</pre>
<pre contenteditable>border-left: width style color;</pre>
<pre contenteditable>border-top: 5px dashed rgba(217,68,11, 0.8);</pre>
<ul>
<li>style is REQUIRED.</li>
<li>width defaults to <span class="imp">medium</span></li>
<li>color defaults to <span class="imp">currentColor</span></li>
<li>IE up to 8 is buggy</li>
</ul>
</section>
</div>
<!--border-radius -->
<div class="slide">
<header><h1>border-radius</h1></header>
<section class="content">
<div class="radius">
<div><pre contenteditable>border-radius: 0;</pre> <b></b>
</div>
<div><pre contenteditable>border-radius: 20px;</pre><b style="border-radius: 20px"></b>
</div>
<div><pre contenteditable>border-radius: 50%;</pre><b style="border-radius: 50%"></b>
</div>
</div>
<ul class="icons" style="clear: both;">
<li class="chrome">Chrome / Chrome 4</li>
<li class="safari">Safari 3 / Safari 5</li>
<li class="firefox">Firefox 1 / Firefox 4</li>
<li class="opera"> <br/> Opera 10.5</li>
<li class="ie"> <br/> IE 9</li>
</ul>
<pre contenteditable style="float: left; margin-right: 40px;">border-top-left-radius
border-top-right-radius
border-bottom-right-radius
border-bottom-left-radius</pre>
<ul sytyle="float: left; overflow: hidden;">
<li>-moz- prefix for 3.6 and earlier</li>
<li>longhand syntax in FF3.6</li>
<li>% works since Safari 5.1 and FF 4.0</li>
</ul>
</section>
</div>
<!--border-radius -->
<div class="slide">
<header><h1>border-radius</h1></header>
<section class="content">
<div class="radius">
<div><pre contenteditable>.circle {border-radius: 50%;}</pre> <b style="border-radius: 50%;"></b></div>
<div><pre contenteditable>.oval { border-radius: 50%;}</pre> <b style="border-radius: 50%; width: 100px;"></b></div>
<div><pre contenteditable>.different { border-radius: 10px 30px;}</pre> <b style="border-radius: 10px 30px; "></b></div>
<div><pre contenteditable>.elliptical { border-radius: 10px / 30px;}</pre> <b style="border-radius: 10px / 30px;"></b></div>
<div><pre contenteditable>.uglier {
border-radius: 10px 35px 20px 15px /
30px 35px 5px 5px;}</pre> <b style="border-radius: 10px 35px 20px 15px / 30px 35px 5px 5px; width: 75px; height: 75px;"></b></div>
</div>
</section>
</div>
<div class="slide object">
<header><h1>Play with border-radius</h1></header>
<object data="files/82_borderradius.html"></object>
<a href="files/82_borderradius.html" target="play" class="objectlink">Try it out</a>
</div>
<!-- Border Images-->
<div class="slide intro">
<header><h1>Border Images</h1></header>
</div>
<!-- what is -->
<div class="slide normal">
<header><h1>What is Border Image</h1></header>
<section class="content">
<div class="whatisborderimage">
</div>
</section>
</div>
<!-- -->
<div class="slide">
<header><h1>border-image</h1></header>
<section class="content">
<pre contenteditable><b>border-image</b>: source || slice / width / outset || repeat;</pre>
<ul class="icons" style="clear: both;">
<li class="chrome">Chrome 1/16</li>
<li class="safari">Safari 3.1/6</li>
<li class="firefox">Firefox 3.5/15</li>
<li class="opera">Opera 10.5</li>
<li class="ie new">IE 11</li>
</ul>
<h1 style="text-align:left">Underlying Properties</h1>
<ul style="float:right">
<li>Syntax for non-prefixed differs</li>
<li>Must also declare <code>border-style</code></li>
<li><a href="http://border-image.com/">Border image tool</a></li>
<li><a href="http://www.sitepoint.com/css3-border-image/">border-image tutorial</a></li>
<li><a href="http://www.standardista.com/css3/css3-border-properties">border-image browser support</a></li>
</ul>
<ul>
<li>border-image-source</li>
<li>border-image-slice</li>
<li>border-image-width</li>
<li>border-image-outset</li>
<li>border-image-repeat</li>
<li class="imp">border-image</li>
</ul>
</section>
</div>
<div class="slide">
<header><h1>border-image</h1></header>
<section class="content">
<pre contenteditable>
<b>border-image-source</b>: <strong>none</strong> | url() | <image>
<b>border-image-slice</b>: <number> | XX% {1,4} && fill
<b>border-image-width</b>: <length> | XX% | <number> | <strong>1</strong> | auto {1,4}
<b>border-image-outset</b>: <length> | <number> {1,4}
<b>border-image-repeat</b>: <strong>stretch</strong> | repeat | round {1,2}
</pre>
<pre contenteditable style="float:right; margin-bottom:40px;">
S = <input type="range" id="slice" min="0" max="50" value="34" step="1" onChange="changeBorderImage();">
W = <input type="range" id="width" min="0" max="50" value="34" step="1" onChange="changeBorderImage();">
<select id="repeat" onChange="changeBorderImage();"><option value="stretch" selected>stretch</option><option value="repeat">repeat</option><option value="round">round</option></select> </pre>
<div id="boderimage"></div>
<pre contenteditable style="clear:both;">border-image: url(gradient.png) <b id="sliceval">34</b> / <b id="widthval">34</b><b>px</b> <b id="repeatval">stretch</b>;</pre>
</section>
<script defer>
function changeBorderImage(){
var slice = document.getElementById('slice').value;
var width = document.getElementById('width').value;
var repeat = document.getElementById('repeat');
repeat = repeat.options[repeat.selectedIndex].text;
document.getElementById('boderimage').style.webkitBorderImage = "url(http://standardista.com/articles/gradient.png) " + slice + "/" + width + "px " + repeat;
document.getElementById('boderimage').style.mozBorderImage = "url(http://standardista.com/articles/gradient.png) " + slice + "/" + width + "px " + repeat;
document.getElementById('sliceval').innerHTML = slice;
document.getElementById('widthval').innerHTML = width;
document.getElementById('repeatval').innerHTML = repeat;
}
</script>
</div>
<div class="slide object">
<header><h1>Play with border-image</h1></header>
<object data="files/83_longcat.html"></object>
<a href="files/83_longcat.html" target="play" class="objectlink">Try it out</a>
</div>
<div class="slide intro">
<header><h1>Part 9: Gradients</h1></header>
<h1><a href="../gradients/">Next ➹</a></h1>
</div>
</div>
<script src="slides.js"></script>
</body>
</html>