-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
1184 lines (1145 loc) · 40.6 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
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="./CssNotes/css/utilities.css" />
<link rel="stylesheet" href="./CssNotes/css/styles.css" />
<title>Millsaps Notes</title>
</head>
<body>
<!-- ../ = go back -->
<!-- / forward from where I"m from -->
<nav class="nav">
<ul class="topNav_ul">
<li><a href="#inheritance" class="navlink">Inheritance</a></li>
<li><a href="#cascadeSummary" class="navlink">Cascade Summary</a></li>
<li><a href="#@rules" class="navlink">@rules/basic functions</a></li>
<li>
<a href="#shorthands" class="navlink">Shorthands/Properties intro</a>
</li>
<li>
<a href="#outerDisplayModels" class="navlink"
>Outer Display Models - Block and Inline.</a
>
</li>
<li>
<a href="#InnerDisplayModels" class="navlink"
>InnerDisplayModels (Brief)</a
>
</li>
<li>
<a href="#margins" class="navlink">Margins</a>
</li>
<li>
<a href="#paddings" class="navlink">Padding</a>
</li>
<li>
<a href="#borders" class="navlink">Borders</a>
</li>
<li>
<a href="#Boxmodel" class="navlink">The box model</a>
</li>
<li>
<a href="#inlineBlocks" class="navlink">Inline Blocks</a>
</li>
<li>
<a href="#Overflow" class="navlink">Overflow</a>
</li>
<li>
<a href="#valuesAndUnits" class="navlink">Sizing, values, Units</a>
</li>
<li>
<a href="#emsVrems" class="navlink">Ems vs rems</a>
</li>
</ul>
</nav>
<div class="mx-auto" style="padding-top: 10px">
<!-- ! -------------- INHERITANCE -------------- -->
<!-- https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Cascade_and_inheritance#understanding_inheritance -->
<section class="example">
<h2 id="inheritance" title="" class="heading">Inheritance</h2>
<ul class="inheritanceParent1">
<li>Child One</li>
<li>
Child Two
<ul>
<li>2.1 (Inheriting from parent)</li>
<li>2.2</li>
</ul>
</li>
<li>
Item Three
<ul class="inheritanceParent2">
<li>
3.1
<ul>
<li>3.1.1</li>
<li>3.1.2</li>
</ul>
</li>
<li>3.2</li>
</ul>
</li>
</ul>
<h3>
Some props that inherit (obviously things that border, padding, and
width do not make sense to inherit) (not exhaustive)
</h3>
<div class="flex">
<ul>
<li>color</li>
<li>cursor</li>
<li>font-family</li>
<li>font-size</li>
<li>font-style</li>
<li>font-variant</li>
<li>font-weight</li>
<li>font-size-adjust</li>
<li>font-stretch</li>
<li>font</li>
<li>letter-spacing</li>
<li>line-height</li>
<li>list-style-image</li>
<li>list-style-position</li>
<li>list-style-type</li>
<li>list-style</li>
</ul>
<ul>
<li>text-align</li>
<li>text-indent</li>
<li>text-justify</li>
<li>white-space</li>
<li>word-break</li>
<li>word-spacing</li>
<li>word-wrap</li>
</ul>
</div>
<p>
We can manually control inheritance using the properities of inherit
(to force inheritance), initial (to set to initial non-inherited
value)
</p>
</section>
<section id="cascadeSummary">
<h2 class="heading">
Summary of of the cascade (Later ones override the first ones in this
list)
</h2>
<ol>
<li>Inheritance from parents to children</li>
<li>
Source Order in the file, (What is last takes priority over what is
first IF the specificity is the same. Same applies to order of
stylesheets;
</li>
<li>
Specificity
<ul>
<li>Inline styles = 1000pts</li>
<li>Id styles (#) = 100</li>
<li>
classes (preferred method), attributes and psuedo classes = 10
points
</li>
<li>elements (e.g. h1 {rules}) = 1 points</li>
</ul>
</li>
<li>The "important word" (Most specific. Generally avoid)</li>
</ol>
<div>
<h4>Review</h4>
<h3 class="normal">
What is going to happen with these two paragraphs in the code block
below?
</h3>
<div class="hiddenQ">
<span class="better">This is a paragraph.</span>
<span class="better" id="winning"
>One selector to rule them all!</span
>
</div>
<button data-role="revealAnswer">Toggle answer</button>
<pre>
<p class="better">This is a paragraph.</p>
<p class="better" id="winning">One selector to rule them all!</p>
#winning {
background-color: red;
border: 1px solid black;
}
.better {
background-color: gray;
border: none !important;
}
p {
background-color: blue;
color: white;
padding: 5px;
}
</pre
>
</div>
</section>
<section id="@rules">
<h2 class="heading">@ rules, basic functions</h2>
<div>
<h3 class="">@ rules</h3>
<p>Tell CSS how to behave or perform special operations</p>
<p>Some common ones include:</p>
<ul>
<li>
@import at top of file = The @import CSS at-rule is used to import
style rules from other style sheets. (Can be used to keep sheets
separate)
</li>
<li>
@media -most commonly seen; A conditional group rule that will
apply its content if the device meets the criteria of the
condition defined using a media query.
</li>
<li>@keyframes - a rule for creating animation sequences</li>
<li>@font-face - including an external font (other ways too)</li>
</ul>
<h4 class="mediaQueryExample slide">
I have a @ media query and that will change my color and @keyframes
for animation. (Click me to stop moving)
</h4>
<pre>
@media screen and (max-width: 700px) {
.blue {
color: green;
}
}
@keyframes slide {
0% {
transform: translateX(0);
}
100% {
transform: translateX(200px);
}
}
</pre>
</div>
<div>
<h3>Awareness of Functions</h3>
<p>
While most values are relatively simple keywords or numeric values,
there are some values that take the form of a function. Functions
are marked by the ()
</p>
<a href="https://css-tricks.com/complete-guide-to-css-functions/"
>See list here</a
>
<pre>
.box {
padding: 10px;
width: calc(90% - 30px);
background-image: url('path.jpg')
filter: drop-shadow(0.25rem 0 0.75rem #ef9035);
color: rgb(255, 0, 0)
}
</pre>
<div>
<h4>
Question: What happens if I give the Computer CSS that it doesn't
understand?
</h4>
<p class="hiddenQ">
Nothing! It doesn't break; It just skips it and moves on to the
next rule;
</p>
<button data-role="revealAnswer">Toggle answer</button>
<div>
<h4>Question: What will happen here?</h4>
<pre>
.box {
width: 500px;
width: calc(100% - 50px);
}
</pre>
<p class="hiddenQ">
The second one will be used IF the browser understands the
property;
</p>
<button data-role="revealAnswer">Toggle answer</button>
</div>
</div>
</div>
</section>
<section>
<h2 id="shorthands" class="heading">Introduction to Properties</h2>
<div>
<h3>A note on ShortHands</h3>
<blockquote>
<p>
/* In 4-value shorthands like padding and margin, the values are
applied in the order top, right, bottom, left (clockwise from the
top). There are also other shorthand types, for example 2-value
shorthands, which set padding/margin for top/bottom, then
left/right */
</p>
<pre>
padding: 10px 15px 15px 5px;
IS EQUAL TO:
padding-top: 10px;
padding-right: 15px;
padding-bottom: 15px;
padding-left: 5px;
</pre>
</blockquote>
<p>
And this one line uses a 2 part shorthand to set the Y axis (top and
bottom) and then the X axis (right and left)
</p>
<pre>
padding: 10px 20px;
is EQUAL TO:
padding-top: 10px;
padding-right: 20px;
padding-bottom: 10px;
padding-left: 20px;
</pre>
<p>
And this one line uses a 3 part shorthand to set the top, Right/Left
and then the bottom
</p>
<pre>
padding: 10px 20px 30px;
IS EQUAL TO:
padding-top: 10px;
padding-right: 20px;
padding-bottom: 30px;
padding-left: 20px;
</pre>
<p>And this one line</p>
<pre>
background: red url(bg-graphic.png) 10px 10px repeat-x fixed;
</pre>
<p>
Equals these five lines: (though I personally don't prefer these
sorts of shorthand for things like animation and background)
</p>
<pre>
background-color: red;
background-image: url(bg-graphic.png);
background-position: 10px 10px;
background-repeat: repeat-x;
background-attachment: fixed;
</pre>
</div>
<div id="outerDisplayModels">
<h2>
Outer Display Models and Intro to Box Model (click boxes for
differences)
</h2>
<div class="flex justify-apart">
<div style="width: 50%">
<h4 class="normal">Block</h4>
<ul class="oneAtATimeContainers">
<li class="opacity0">The box will break onto a new line.</li>
<li class="opacity0">
The box will extend in the inline direction to fill the space
available in its container. In most cases this means that the
box will become as wide as its container, filling up 100% of
the space available.
</li>
<li class="opacity0">
The width and height properties are respected.
</li>
<li class="opacity0">
Padding, margin and border will cause other elements to be
pushed away from the box
</li>
</ul>
</div>
<div style="width: 50%">
<h4 class="normal">Inline</h4>
<ul class="oneAtATimeContainers">
<li class="opacity0">
The box will not break onto a new line..
</li>
<li class="opacity0">
The width and height properties will not apply.
</li>
<li class="opacity0">
Vertical padding, margins, and borders will apply but will not
cause other inline boxes to move away from the box.
</li>
<li class="opacity0">
Horizontal padding, margins, and borders will apply and will
cause other inline boxes to move away from the box.
</li>
</ul>
</div>
</div>
<div id="blockVsInline">
<h3>Example</h3>
<p class="border">I am one short paragraph with display block</p>
<p class="inline">
I am a block element normally, but made inline;
</p>
<p class="inline">
I am a new element, also a block element normally, but made
inline; I'm next to the other guy;
</p>
<p class="border">
I am another. Some of my words
<span class="border normal boxModel blockToInline"
>Have been wrapped</span
>
in a span. Spans and A tags are inline by default;
<button class="block makeBlock" style="margin-top: 5px">
Toggle the span to a block and back to inline;
</button>
</p>
</div>
<div id="InnerDisplayModels" class="my-3">
<h2>Inner Display Models</h2>
<p>
Note: There are also inner display models; These control how the
CHILDREN of an element are rendered. The default is for the
children to control themselves, but new properties (display: flex
and display:grid) allow a parent to lay out the children as inline
or as grid items; We will cover these in depth later; Brief
example here
</p>
<h4>
This is a box with display:flex controlling it's children layout
model
</h4>
<div class="flex border" style="padding: 20px">
<div class="box box1">I am one div</div>
<div class="box box2" style="margin: 100px">I sit inline,</div>
<div class="box box3">I am 3</div>
</div>
<button class="mt-2 toggleFlex">Toggle Flex</button>
<span>Display is flex</span>
</div>
<div id="Boxmodel">
<h2>The Box Model</h2>
<img src="./CssNotes/media/box-model.png" alt="boxModel" />
<h3>The Standard Box model</h3>
<div id="StandardBoxModel">
<p>
MDN ~ In the standard box model, if you give a box a width and a
height attribute, this defines the width and height of the
content box. Any padding and border is then added to that width
and height to get the total size taken up by the box.
</p>
<pre>
.box {
width: 350px;
height: 150px;
margin: 10px;
padding: 25px;
border: 5px solid black;
}
</pre
>
The space taken up by our box using the standard box model will
actually be 410px (350 + 25 + 25 (LR Padding) + 5 + 5 (LR
border)), and the height 210px (150 + 25 + 25 + 5 + 5), as the
padding and border are added to the width used for the content
box.
<img
src="./CssNotes/media/standard-box-model.png"
alt="Standard Box Model"
/>
</div>
<div id="alternativeBoxModel">
<h3>The Alternative Box Model</h3>
<p>
Calculating dimensions like that is pretty annoying. As such, an
alternative (and more popular box-model was introduced after the
standard one); In this model, the padding and border subtracts
from the content area
</p>
<img
src="./CssNotes/media/alternate-box-model.png"
alt="alternate box model"
/>
<p>To turn on the alternate box model, the property is:</p>
<pre>
.box {
box-sizing: border-box;
}
</pre
>
and many developers have it turned on for every box by selecting
every element with this ruleset:
<pre>
html {
box-sizing: border-box;
}
*, *::before, *::after {
box-sizing: inherit;
}
</pre
>
<b>Tip! Visualize the box model using your browser's dev tools</b>
</div>
<div id="margin/padding/border">
<h2>Margin, padding, and borders</h2>
<div id="margins">
<h3>Margin</h3>
<ul>
<li>
Margin is invisible space around your box that pushes other
elements away
</li>
<li>Can be positive or negative (more often pos)</li>
<li>Negative can be used to cause overlapping</li>
<li>
Uses the shorthand <code>margin</code> property, or the
<code
>margin-top, margin-right, margin-bottom, or margin-left </code
>properties
</li>
</ul>
<div class="flex">
<div class="border" style="padding: 5px; background: teal">
<div class="marginbox">
I am the content margin references
</div>
</div>
<div>
<div style="margin-left: 5px">
<label for="marginTop" class="block">Margin Top </label>
<input
type="number"
id="margin-top"
name="marginTop"
class="margin-controller"
min="-500"
max="500"
value="0"
/>
<label for="marginRight" class="block"
>Margin Right
</label>
<input
type="number"
name="marginRight"
class="margin-controller"
min="-500"
max="500"
value="0"
/>
<label for="marginBottom" class="block"
>Margin Bottom
</label>
<input
type="number"
name="marginBottom"
class="margin-controller"
min="-500"
max="500"
value="0"
/>
<label for="marginLeft" class="block">Margin Left </label>
<input
type="number"
name="marginLeft"
class="margin-controller"
min="-500"
max="500"
value="0"
/>
<label for="All_Margins" class="block">All Margins</label>
<input
type="number"
id="All_Margins"
name="margin"
class="margin-controller"
min="-500"
max="500"
value="0"
/>
</div>
</div>
</div>
<div id="collapsingMargins">
<h3>Collapsing Margins: (Top and bottom only)</h3>
<p>
When a top and bottom margin overlap, only the larger of the
2 is taken adn the margins are "collapsed"; If one margin is
negative, it subtracts for the other;
</p>
<div id="outerBox" class="mt-2 border">
<div class="box box2" style="margin-bottom: 50px">
My bottom margin is 50px
</div>
<div class="box box3" style="margin-top: 68px">
My top margin is 30px; But if you inspect in dev tools,
the gap is only 50
</div>
</div>
</div>
</div>
<div id="paddings">
<h3>Padding</h3>
<ul>
<li>
The padding sits between the border and the content area.
</li>
<li>
Unlike margins you cannot have negative amounts of padding,
so the value must be 0 or a positive value
</li>
<li>
Any background applied to your element will display behind
the padding, and it is typically used to push the content
away from the border.
</li>
<li>Same shorthand as margin</li>
</ul>
<div class="flex" style="margin-top: 40px">
<div
class="paddingbox"
style="
background: #ccc;
padding: 50px;
border: solid yellow 10px;
"
>
<span class="normal">
See my gray padding grow and push these words away from
the yellow border</span
>
</div>
<div>
<div>
<label for="paddingTop" class="block">padding Top </label>
<input
type="number"
id="padding-top"
name="paddingTop"
class="padding-controller"
min="-500"
max="500"
value="50"
/>
<label for="paddingRight" class="block"
>padding Right
</label>
<input
type="number"
name="paddingRight"
class="padding-controller"
min="-500"
max="500"
value="50"
/>
<label for="paddingBottom" class="block"
>padding Bottom
</label>
<input
type="number"
name="paddingBottom"
class="padding-controller"
min="-500"
max="500"
value="50"
/>
<label for="paddingLeft" class="block"
>padding Left
</label>
<input
type="number"
name="paddingLeft"
class="padding-controller"
min="-500"
max="500"
value="50"
/>
<label for="All_Paddings" class="block"
>All Paddings</label
>
<input
type="number"
id="All_Paddings"
name="padding"
class="padding-controller"
min="-500"
max="500"
value="0"
/>
</div>
</div>
</div>
<div id="alinkPaddingExample" style="margin-top: 50px">
<h4>A Padding and Link tip (Bigger hitboxes)</h4>
<a href="#" style="background: green; color: white"
>Without Padding</a
>
<a
href="#"
style="padding: 20px; background: blue; color: white"
>With Padding</a
>
</div>
</div>
<div id="borders">
<h3>Border</h3>
<ul>
<li>
The border is drawn between the margin and the padding of a
box.
</li>
<li>
If you are using the <b>standard box model</b> , the size of
the border is added to the width and height of the box. I
</li>
<li>
If you are using the <b>alternative box model </b> then the
size of the border makes the <b> content box smaller </b> as
it takes up some of that available width and height.
</li>
<li>
For styling borders, there are a large number of properties
— there are four borders, and each border has a
<b> style, width and color </b> that we might want to
manipulate.
</li>
<li>
The same top, right, bottom, left shorthand applies; You'll
often seem somethign like
<code>border: solid 1px blue</code> as a shorthand as well;
</li>
<li>
<pre>
<code>
border-(side)-width: value;
border-(top, right,bottom,left)-style: value;
border-color: value;
</code>
| = "or"
Styles: = none | hidden | dotted
| dashed | solid | double | groove
| ridge | inset | outset
</pre>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id="inlineBlocks">
<h2>Inline blocks - A middle ground</h2>
<p>
For inline items to respect width, height, and avoid horizontal
overlapping.
</p>
<p class="border">
I am a sentence. Some of my words
<span class="inline-block border normal inline-block-example"
>Have been wrapped</span
>
in a span. Spans and A tags are inline by default;
<button class="block toggleInlineBlock" style="margin-top: 5px">
Toggle the span between inline-block and inline
</button>
<span> Display is inline-block; </span>
</p>
</div>
</section>
<!-- todo: https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units: Check bottom -->
<section id="Overflow">
<h2>A brief note on overflowing content and the box model;</h2>
<p>
Overflow is what happens when there is too much content to fit in a
box
</p>
<p class="border" style="height: 25px">
I overflow vertically due to a set height; Lorem ipsum dolor sit amet
consectetur; Lorem, ipsum dolor.
</p>
<p class="border" style="width: 25px; margin-top: 50px">
Width overflow due to static width:
</p>
<p>
CSS is trying to prevent data loss;
<u
>As MDN Summarizes - "If you restrict a box with a width or a
height, CSS trusts you to know what you are doing and assumes you
are managing for overflow."
</u>
</p>
<p>
Today, many methods of position elements dont' require fixing static
heights. Using fixed-heights is typically not a great practice unless
vertical scrolling is purposely desired; (Adjusting width is a good
bit more common);
</p>
<div class="flex justify-around p-5 border interactiveExample">
<div
data-cssprop="overflow"
data-queryName="overflowExample"
class="border"
style="width: 50px; height: 20px; font-size: 25px"
>
<p class="m-0">Lorem ipsum dolor</p>
</div>
<div data-name="radio-holder">
<div>
<label for="auto">overflow:auto;</label>
<input
data-queriesFor="overflowExample"
data-role="interactiveInput"
data-cssmutated="overflow"
type="radio"
name="overflow"
id="auto"
value="auto"
/>
</div>
<div>
<label for="visible">overflow: visible</label>
<input
data-queriesFor="overflowExample"
data-role="interactiveInput"
data-cssmutated="overflow"
type="radio"
name="overflow"
id="visible"
value="visible"
/>
</div>
<div>
<label for="hidden">overflow: Hidden</label>
<input
data-queriesFor="overflowExample"
data-role="interactiveInput"
data-cssmutated="overflow"
type="radio"
name="overflow"
id="hidden"
value="hidden"
/>
</div>
<div>
<label for="scroll">overflow: scroll</label>
<input
data-queriesFor="overflowExample"
data-role="interactiveInput"
type="radio"
name="overflow"
id="scroll"
value="scroll"
/>
</div>
</div>
</div>
</section>
<section id="valuesAndUnits">
<h2>Common Values and Units</h2>
<h3>Most common Lengths</h3>
<table>
<thead>
<tr>
<th scope="col">Unit</th>
<th scope="col">Name</th>
<th scope="col">Notes</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center" colspan="3">Absolute Units</td>
</tr>
<tr>
<td><code>px</code></td>
<td>Pixels</td>
<td>
1px = 1/96th of 1in or 1 tiny square dot of light on your screen
</td>
</tr>
<tr>
<td style="text-align: center" colspan="3">relative Units</td>
</tr>
<tr>
<td><code>em</code></td>
<td colspan="2">
Font size of the parent, in the case of typographical properties
like font-size, and font size of the element itself, in the case
of other properties like width.
</td>
</tr>
<tr>
<td><code>rem</code></td>
<td colspan="2">Font size of the root element.</td>
</tr>
<tr>
<td><code>%</code></td>
<td colspan="2">
A percentage of the parent with respect to that property; (e.g.
50% of 400px or 80% of 100% width);
</td>
</tr>
<tr>
<td><code>vw</code></td>
<td colspan="2">1% of the viewport's width.</td>
</tr>
<tr>
<td><code>vh</code></td>
<td colspan="2">1% of the viewport's height.</td>
</tr>
<tr>
<td><code>ch</code></td>
<td colspan="2">
The advance measure (width) of the glyph "0" of the element's
font.
</td>
</tr>
</tbody>
</table>
<h4>
See the
<a
href="https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units"
>MDN units reference</a
>
here; (Hard to summarize better) Has details on other keywords and
colors
</h4>
</section>
<section id="SizingItems">
<h2>Sizing Items - Height, Width, max-min</h2>
<p>
I'm not the best at design: The summary I try to keep in mind for
myself is from a UI/UX developer named Gary Simon is this:
<i>
The fundamentals are: White space, alignment, contrast, scale,
typography, color, and visual hierarchy
</i>
</p>
<div id="emsVrems">
<h3>A note on a sizing unit - Ems vs rems</h3>
<ul class="ems">
<li>One</li>
<li>Two</li>
<li>
Three
<ul>
<li>Three A</li>
<li>
Three B
<ul>
<li>Three B 2</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul class="rems">
<li>One</li>
<li>Two</li>
<li>
Three
<ul>
<li>Three A</li>
<li>
Three B
<ul>
<li>Three B 2</li>
</ul>
</li>
</ul>
</li>
</ul>
<pre>
html {
font-size: 16px;
}
.ems li {
font-size: 1.3em;
}
.rems li {
font-size: 1.3rem;
}
</pre
>
<p>
To recap, the em unit means "my parent element's font-size" in the
case of typography or my own font size for properties like width;
</p>