forked from estelle/cssmastery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
677 lines (534 loc) · 19.8 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
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>CSS: Flexbox</title>
<link rel="stylesheet" href="../selectors/selectors.css"/>
<link rel="stylesheet" href="flexbox.css"/>
</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="presentation">
<div id="presentation-counter"></div>
<div id="slides">
<div class="slide divider">
<h1>CSS: Flexbox</h1>
</div>
<!-- divider -->
<div class="slide divider">
<h1>Why?</h1>
</div>
<div class="slide object">
<header><h1>Problem we're trying to solve</h1></header>
<object data="files/float.html"></object>
<a href="files/float.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide object">
<header><h1>Flex Box</h1></header>
<object data="files/textflex.html"></object>
<a href="files/textflex.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide object">
<header><h1>Flex Box</h1></header>
<object data="files/homepage.html"></object>
<a href="files/homepage.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide object">
<header><h1>Flex Box</h1></header>
<object data="files/homepagemobile.html"></object>
<a href="files/homepagemobile.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide object">
<header><h1>Flex Box</h1></header>
<object data="files/magiclayout.html"></object>
<a href="files/magiclayout.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide object">
<header><h1>Fixed Header and Footer </h1></header>
<object data="files/fixedfooter.html"></object>
<a href="files/fixedfooter.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide object">
<header><h1>Flex Box</h1></header>
<object data="files/button.html"></object>
<a href="files/button.html" target="play" class="objectlink">↪</a>
</div>
<!-- divider -->
<div class="slide divider">
<h1>Browser Support</h1>
</div>
<!-- General Browser Support -->
<div class="slide object">
<header><h1>Browser support <button onclick="loadCIU(this)">load CANIUSE.com</button></h1></header>
<object id="caniuse"></object>
<a href="http://caniuse.com/#search=flexbox" target="play" class="objectlink">↪</a>
<script>
// required because autofocus in caniuse breaks the presentation
function loadCIU(e){
var obj = document.getElementById('caniuse');
obj.setAttribute('data', 'http://caniuse.com/#search=flexbox');
e.style.display = 'none';
return false;
}
</script>
</div>
<div class="slide divider">
<header><h1>Flex Box Specification</h1></header>
<section class="content">
<p>CSS Flexible Box Layout Module Level 1</p>
<a href="http://dev.w3.org/csswg/css-flexbox/" target="play2">dev.w3.org/csswg/css-flexbox/</a>
<p>Candidate Recommendation: Jan-05-2016</p>
</section>
</div>
<div class="slide object">
<header><h1>So simple...</h1></header>
<object data="files/explain.html"></object>
<a href="files/explain.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide object">
<header><h1>Holy Grail Layout</h1></header>
<object data="files/pagelayout.html"></object>
<a href="files/pagelayout.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide">
<header><h1>Components of Flexbox</h1></header>
<section class="content">
<ol>
<li><strong>Creation</strong>: display</li>
<li><strong>Direction</strong>: flex-flow (flex-direction, flex-wrap)</li>
<li><strong>Alignment</strong>: justify-content, align-items, align-self, align-content</li>
<li><strong>Ordering</strong>: order</li>
<li><strong>Flexibility</strong>: flex (flex-grow, flex-shrink, flex-basis)</li>
</ol>
</section>
</div>
<div class="slide">
<header><h1>Flexible Box Properties</h1></header>
<section class="content">
<dl class="deprecated listed">
<dt> display</dt>
<dd>Values include <code>flex</code> and <code>inline-flex</code>. Used on parent to create the flex container.</dd>
<dt> align-content</dt>
<dd>flex-start | flex-end | center | space-between | space-around | <code>stretch</code> | space-evenly</dd>
<dt> align-items</dt>
<dd>flex-start | flex-end | center | baseline | <code>stretch</code></dd>
<dt> align-self</dt>
<dd><code>auto</code> | flex-start | flex-end | center | baseline | stretch</dd>
<dt> flex</dt>
<dd> Shorthand for <code>[flex-basis flex-grow, and flex-shrink</code>, or <code>none</code></dd>
<dt> flex-basis</dt>
<dd>The basis by which the flex-items flex. default: auto</dd>
<dt> flex-direction</dt>
<dd> Set the containers axis for its children with <code>row</code>, <code>row-reverse</code>, <code>column</code> or <code>columns-reverse</code> on the parent</dd>
<dt> flex-flow</dt>
<dd>Shorthand for <code>flex-direction</code> and <code>flex-wrap</code> properties.</dd>
<dt> flex-grow</dt>
<dd>Positive number determines how much flex item will grow relative to other flex items in flex container when positive free space is distributed. default is 1 for container. 0 for children. Positive only</dd>
<dt> flex-shrink</dt>
<dd>Positive number determines how much flex item will shrink relative to other flex items in flex container when negative free space is distributed. default is 1</dd>
<dt> flex-wrap</dt>
<dd> To determine whether the boxes are single line or wrap, and the direction, use <code>nowrap</code>, <code>wrap</code> or <code>wrap-reverse</code></dd>
<dt> justify-content</dt>
<dd><code>flex-start</code> | flex-end | center | space-between | space-around | space-evenly</dd>
<dt> min-height</dt>
<dd>Default is <code>auto</code>, not <code>0</code></dd>
<dt> min-width</dt>
<dd>Default is <code>auto</code>, not <code>0</code></dd>
<dt>order</dt>
<dd>Integer. Controls order of flex item within flex container</dd>
</dl>
</section>
</div>
<!-- divider -->
<div class="slide divider">
<h1>The Basics</h1>
</div>
<div class="slide">
<header><h1>Steps</h1></header>
<section class="content">
<ol>
<li>Add <code>display: flex;</code> to the parent of the elements to be flexed.</li>
<li>Set <code>flex-direction</code> to horizontal or vertical</li>
<li>Set <code>flex-wrap</code> to control wrap direction</li>
</ol>
</section>
</div>
<div class="slide">
<header><h1><code>display</code> property</h1></header>
<section class="content">
<p><code style="color: inherit">
inline | block | list-item | inline-list-item | inline-block | <strong>flex | inline-flex</strong> | grid | inline-grid | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-cell | table-column-group | table-column | table-caption | ruby | ruby-base | ruby-text | ruby-base-container | ruby-text-container | contents | none | flow | flow-root</code>
</p>
</section>
</div>
<div class="slide">
<header><h1><code>display</code> property</h1></header>
<section class="content">
<p><code style="color: inherit">
inline | block | list-item | inline-block | <strong>flex | inline-flex</strong> | grid | inline-grid | table | inline-table | ruby | none </code>
</p>
<pre><strong>display: flex;</strong></pre>
<p>block-level flex container box</p>
<pre><strong>display: inline-flex;</strong></pre>
<p>inline-level flex container box</p>
</section>
</div>
<div class="slide">
<header><h1>Is Flexbox supported in your browser?</h1></header>
<figure><iframe height='550' scrolling='no' src='http://codepen.io/estelle/embed/KCzfH/' frameborder='no' allowtransparency='true' allowfullscreen='true' style='width: 100%; height: 80vh'>See the Pen <a href='http://codepen.io/estelle/pen/KCzfH/'>Browser @support for Flexbox</a> by Estelle Weyl (<a href='http://codepen.io/estelle'>@estelle</a>) on <a href='http://codepen.io'>CodePen</a>.
</iframe></figure>
<a href="http://codepen.io/estelle/pen/KCzfH/" class="objectlink" target="_new">Visit Site</a>
</div>
<div class="slide object">
<header><h1><code>display</code> property</h1></header>
<object data="files/display.html"></object>
<a href="files/display.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide object">
<header><h1>display: inline-flex;</h1></header>
<object data="files/button.html"></object>
<a href="files/button.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide">
<header><h1>What is a flex item</h1></header>
<section class="content">
<p>Flex items</p>
<ol>
<li>All non-absolutely positioned child nodes</li>
<li>Generated Content</li>
<li>anonymous flex items => non-empty text nodes</li>
</ol>
<p>Not flex items</p>
<ol>
<li>::first-line & ::first-letter</li>
<li>white space</li>
</ol>
<p>Kind of</p>
<ol>
<li>absolutely/fixed positioned elements</li></ol>
</section>
</div>
<div class="slide">
<header><h1>Impacted CSS Properties</h1></header>
<section class="content">
<p>Changed Properties</p>
<ol>
<li><code>margin</code>: adjacent flex items margins do not collapse</li>
<li><code>min-width</code> & <code>min-height</code>: default is auto, not 0</li>
<li><code>visibility: collapse;</code></li>
</ol>
<p>Ignored Properties</p>
<ol>
<li>column-* properties</li>
<li>float</li>
<li>clear</li>
<li>vertical-align </li>
</ol>
</section>
</div>
<div class="slide">
<header><h1><code>flex-direction</code> property</h1></header>
<section class="content">
<ul>
<li><code><strong>row</strong></code></li>
<li><code>row-reverse</code></li>
<li><code>column </code></li>
<li><code>column-reverse</code></li>
</ul>
</section>
</div>
<div class="slide object">
<header><h1><code>flex-direction: ... </code></h1></header>
<object data="files/direction.html"></object>
<a href="files/direction.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide object">
<header><h1>Flex Box</h1></header>
<object data="files/homepage.html"></object>
<a href="files/homepage.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide object">
<header><h1>main-axis</h1></header>
<object data="files/axes.html"></object>
<a href="files/axes.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide">
<header><h1><code>flex-wrap</code> property</h1></header>
<section class="content">
<ul>
<li><code><strong>nowrap</strong></code></li>
<li><code>wrap</code></li>
<li><code>wrap-reverse</code></li>
</ul>
<p>Purpose: is the whole shebang on one line, or can it wrap if necessary?</p>
</section>
</div>
<div class="slide object">
<header><h1><code>flex-wrap: ...</code></h1></header>
<object data="files/flexwrap.html"></object>
<a href="files/flexwrap.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide object">
<header><h1>Flex Box></h1></header>
<object data="files/magiclayout.html"></object>
<a href="files/magiclayout.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide object">
<header><h1><code>flex-flow</code> property</h1></header>
<section class="content">
<p>Shorthand for <code>flex-direction</code> and <code>flex-wrap</code></p>
</section>
</div>
<div class="slide object">
<header><h1><code>flex-flow: ...</code></h1></header>
<object data="files/flexflow.html"></object>
<a href="files/flexflow.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide object">
<header><h1>flex-flow</h1></header>
<object data="files/multi.html"></object>
<a href="files/multi.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide intro">
<header><h1>"But wait, there's more!"</h1>
<h2>--Ed Valenti</h2></header>
<section class="content">
</section>
</div>
<!-- divider -->
<div class="slide divider">
<h1>The Flex Container</h1>
</div>
<div class="slide intro">
<header>
<h1>Controlling Flex Items</h1>
</header>
<section class="content">
From the flex container
</section>
</div>
<div class="slide">
<header><h1><code>justify-content</code> property</h1></header>
<section class="content">
<ul>
<li><code><strong>flex-start</strong></code></li>
<li><code>flex-end</code></li>
<li><code>center</code></li>
<li><code>space-between</code></li>
<li><code>space-around</code></li>
<li><code>space-evenly</code></li>
</ul>
<p>aligns flex items along the main axis</p>
</section>
</div>
<div class="slide object">
<header><h1><code>justify-content</code> property</h1></header>
<object data="files/justify.html"></object>
<a href="files/justify.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide">
<header><h1><code>align-items</code> property</h1></header>
<section class="content">
<ul>
<li><code>flex-start</code></li>
<li><code>flex-end</code></li>
<li><code>center</code></li>
<li><code>baseline</code></li>
<li><code><strong>stretch</strong></code></li>
</ul>
<p>aligns flex items along the cross axis</p>
</section>
</div>
<div class="slide object">
<header><h1><code>align-items</code> property</h1></header>
<object data="files/align.html"></object>
<a href="files/align.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide object">
<header><h1>Impact of <code>visibility: collapse</code></h1></header>
<object data="files/collapse.html"></object>
<a href="files/collapse.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide">
<header><h1><code>align-content</code> property</h1></header>
<section class="content">
<ul>
<li><code>flex-start</code></li>
<li><code>flex-end</code></li>
<li><code>center</code></li>
<li><code>space-between</code></li>
<li><code>space-around</code></li>
<li><code><strong>stretch</strong></code></li>
<li><code>space-evenly</code></li></ul>
<p>Only applies to multi-line flex containers.</p>
</section>
</div>
<div class="slide object">
<header><h1><code>align-content</code> property</h1></header>
<object data="files/aligncontent.html"></object>
<a href="files/aligncontent.html" target="play" class="objectlink">↪</a>
</div>
<!-- divider -->
<div class="slide divider">
<h1>Flex Items</h1>
</div>
<div class="slide intro">
<header>
<h1>Controlling Flex Items</h1>
</header>
<section class="content">
From the flex items themselves
</section>
</div>
<div class="slide">
<header><h1><code>align-self</code> property</h1></header>
<section class="content">
<ul>
<li><code><strong>auto</strong></code></li>
<li><code>flex-start</code></li>
<li><code>flex-end</code></li>
<li><code>center</code></li>
<li><code>baseline</code></li>
<li><code>stretch</code></li>
</ul>
<p>Override the <code>align-items</code> on a per flex item basis</p>
</section>
</div>
<div class="slide object">
<header><h1><code>align-self</code> property</h1></header>
<object data="files/alignself.html"></object>
<a href="files/alignself.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide object">
<header><h1><code>align-self</code> property</h1></header>
<object data="files/alignself2.html"></object>
<a href="files/alignself2.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide">
<header><h1><code>order</code> property</h1></header>
<section class="content">
<pre>div:nth-of-type(3n) {
order: -1;
}</pre>
<p>The default value is 0. Anything lower will come before those without set values. Anything above will come after.</p>
</section>
</div>
<div class="slide object">
<header><h1><code>order: ...</code></h1></header>
<object data="files/order.html"></object>
<a href="files/order.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide object">
<header><h1>Source Order</h1></header>
<object data="files/homepage.html"></object>
<a href="files/homepage.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide object">
<header><h1><nav> comes after <main></h1></header>
<object data="files/homepagemobile2.html"></object>
<a href="files/homepagemobile.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide">
<header><h1>Accessibility</h1></header>
<section class="content">
<ol>
<li>Source Order</li>
<li>Tab order</li>
<li>Right to Left languages</li>
</ol>
</section>
</div>
<!-- divider -->
<div class="slide divider">
<h1>Flexibility</h1>
</div>
<div class="slide">
<header><h1><code>flex</code> shorthand</h1></header>
<section class="content def">
<p><code>flex-grow</code>:
How to divide the extra space. Non-negative number. default: 1.</p>
<p><code>flex-shrink</code>:
How to shrink if there's not enough room. Non-negative number. default: 1. </p>
<p><code>flex-basis</code>:
the
starting size
before free
space is
distributed. length value, content or <code>auto</code> . If set to <code>auto</code>, sets to flex item’s main size property. </p>
</section>
</div>
<div class="slide object">
<header><h1><code>flex</code> shorthand property</h1></header>
<object data="files/flex.html"></object>
<a href="files/flex.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide object">
<header><h1><code>flex</code> relative numbers</h1></header>
<object data="files/flex3.html"></object>
<a href="files/flex3.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide">
<header><h1><code>flex-basis</code> </h1></header>
<div style="text-align: center;"><img style="margin-top: 100px;" src="images/flexbasis.png" alt="explanation of the difference between auto and 0 for flex basis"></div>
</div>
<div class="slide object">
<header><h1><code>flex-basis</code> </h1></header>
<object data="files/basis.html"></object>
<a href="files/basis.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide object">
<header><h1>Flex Box</h1></header>
<object data="files/finalflex.html"></object>
<a href="files/finalflex.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide object">
<header><h1>Flex Box</h1></header>
<object data="files/notmagic.html"></object>
<a href="files/notmagic.html" target="play" class="objectlink">↪</a>
</div>
<div class="slide divider">
<header><h1>Tables</h1></header>
<h1><a href="../tables">Next ➹</a></h1>
</div>
<div class="slide dots">
<header><h1>Table of Content</h1></header>
<section>
<ol class="column2">
<li><a href="../intro">Introduction</a></li>
<li><a href="../selectors">Selectors</a></li>
<li><a href="../selectors">Specificity</a></li>
<li><a href="../generated">Generated Content</a></li>
<li><a href="../media">Media Queries</a></li>
<li><a href="../sass">Best Practices</a></li>
<li><a href="../debugging">Debugging</a></li>
<li><a href="../colors">Colors & Transparency </a></li>
<li><a href="../flexbox">Flexbox</a></li>
<li><a href="../tables">Tables</a></li>
<li><a href="../grid">Grids</a></li>
<li><a href="../borders">Backgrounds & Borders </a></li>
<li><a href="../gradients">Gradients</a></li>
<li><a href="../transforms">Transforms</a></li>
<li><a href="../animations">Transitions & Animation</a></li>
<li><a href="../other">Other Features</a></li>
</ol>
</section>
</div>
<!-- TOC -->
<div class="slide">
<header><h1>Links</h1></header>
<section class="content">
<ul>
</ul>
</section>
</div>
</div></div>
<script src="../selectors/selectors.js"></script>
</body>
</html>