@@ -14,32 +14,155 @@ <h2 class="chapter-heading">Ch. 22 Introduction to CSS</h2>
14
14
< img src ="img/ch22_how_we_select_and_style_elements.png " alt ="how we select and style elements " class ="lecture-slide ">
15
15
</ article >
16
16
17
+ < article class ="chapter ">
18
+ < h2 class ="chapter-heading "> Ch. 23 Inline, Internal and External CSS</ h2 >
19
+ < article class ="chapter-sub-section ">
20
+ < h3 class ="chapter-sub-section-heading "> Inline CSS</ h3 >
21
+ < article class ="chapter-sub-section ">
22
+ < h4 class ="chapter-sub-section-heading "> An Example of inline CSS</ h4 >
23
+ < code >
24
+ < pre >
25
+ <h1 style="color: blue;">...</h1>
26
+ ...
27
+ <h1 style="color: blue;">...</h1>
28
+ ...
29
+ </ pre >
30
+ </ code >
31
+ </ article >
32
+ </ article >
33
+
34
+ < article class ="chapter-sub-section ">
35
+ < h3 class ="chapter-sub-section-heading "> Internal CSS</ h3 >
36
+ < article class ="chapter-sub-section ">
37
+ < h4 class ="chapter-sub-section-heading "> An Example of Internal CSS</ h4 >
38
+ < code >
39
+ < pre >
40
+ <!DOCTYPE html>
41
+ <html>
42
+ <head>
43
+ ...
44
+ <style>
45
+ h1 {
46
+ color: blue;
47
+ }
48
+ </style>
49
+ </head>
50
+ <body>
51
+ <h1>...<h1>
52
+ </body>
53
+ </html>
54
+ </ pre >
55
+ </ code >
56
+ </ article >
57
+ </ article >
58
+
59
+ < article class ="chapter-sub-section ">
60
+ < h3 class ="chapter-sub-section-heading "> External CSS</ h3 >
61
+ < article class ="chapter-sub-section ">
62
+ < h4 class ="chapter-sub-section-heading "> An Example of External CSS</ h4 >
63
+ < h5 class ="chapter-sub-section-heading "> style.css</ h5 >
64
+ < code >
65
+ < pre >
66
+ h1 {
67
+ color: blue;
68
+ }
69
+ </ pre >
70
+ </ code >
71
+
72
+ < h5 class ="chapter-sub-section-heading "> index.html</ h5 >
73
+ < code >
74
+ < pre >
75
+ <!DOCTYPE html>
76
+ <html>
77
+ <head>
78
+ ...
79
+ <link href="style.css" rel="stylesheet">
80
+ </head>
81
+ <body>
82
+ <h1>...<h1>
83
+ ...
84
+ <h1>...<h1>
85
+ ...
86
+ </body>
87
+ </html>
88
+ </ pre >
89
+ </ code >
90
+ </ article >
91
+
92
+ < article class ="chapter-sub-section ">
93
+ < h3 class ="chapter-sub-section-heading "> Separation of Concern (SoC)</ h3 >
94
+ < p >
95
+ A design principle of separating a program into sections, with each section having a singular concern.
96
+ </ p >
97
+ </ article >
98
+
99
+ < article class ="chapter-sub-section ">
100
+ < h3 class ="chapter-sub-section-heading "> Don't Repeat Yourself (DRY) (Modular Design)</ h3 >
101
+ < p >
102
+ When Separation of Concern is adhered to strongly enough, sections of a program can be re-used,
103
+ thereby reducing the amount of repetative code.
104
+ </ p >
105
+ </ article >
106
+
107
+ < p >
108
+ With 'Modular Design' in mind, the best to worst approach would be external,
109
+ internal and then inline CSS.
110
+ </ p >
111
+ </ article >
112
+
17
113
< article class ="chapter ">
18
114
< h2 class ="chapter-heading "> Ch 24. Styling Text</ h2 >
115
+ < article class ="chapter-sub-section ">
116
+ < h3 class ="chapter-sub-section-heading "> A Selection of Properties</ h3 >
117
+ < ul >
118
+ < li > < code > color</ code > </ li >
119
+ < li > < code > font-family</ code > </ li >
120
+ < li > < code > font-size</ code > </ li >
121
+ < li > < code > font-style</ code > </ li >
122
+ < li > < code > line-height</ code > </ li >
123
+ < li > < code > text-align</ code > </ li >
124
+ < li > < code > text-transform</ code > </ li >
125
+ </ ul >
126
+ </ article >
19
127
< p > Serif means those short, spike-like edges of text.</ p >
20
- < p > The style of an element affects the style of its child elements .</ p >
128
+ < p > The default font-size is 16px .</ p >
21
129
< p >
22
- The style 'text-align: center' positions the text at the center of
23
- parent element.
130
+ It's not about memorizing every property, since therea rea so many, rather get
131
+ to know what is possible with CSS, and in time, you will memorize properties that
132
+ you use a lot.
24
133
</ p >
25
- < p > The default font-size is 16px.</ p >
26
134
</ article >
27
135
28
136
< article class ="chapter ">
29
137
< h2 class ="chapter-heading "> Ch. 25 Combining Selectors</ h2 >
30
- < section class ="chapter-sub-section ">
31
- < p >
32
- A list of selectors can be supplied for a CSS rule (known as a
33
- 'list-selector').
34
- </ p >
138
+ < article class ="chapter-sub-section ">
139
+ < h3 class ="chapter-sub-section-heading "> Why Combine Selectors?</ h3 >
140
+ < p > It reduces the repetativeness of writing CSS (DRY).</ p >
141
+ </ article >
142
+
143
+ < article class ="chapter-sub-section ">
144
+ < h3 class ="chapter-sub-section-heading "> List-Selectors</ h3 >
35
145
< p >
36
- A string of selectors, separated by white-space, can be supplied for a
37
- CSS rule (known as a 'descendent-selector').
146
+ A list of selectors supplied for a CSS rule, whereby every match, for example:
38
147
</ p >
39
- </ section >
40
-
148
+ < code >
149
+ < pre > h1, h2, h3, h4, p, li {
150
+ ...
151
+ }</ pre >
152
+ </ code >
153
+ </ article >
154
+
41
155
< article class ="chapter-sub-section ">
42
156
< h3 class ="chapter-sub-section-heading "> Descendent-Selectors</ h3 >
157
+ < p >
158
+ A string of selectors, separated by white-space, supplied for a
159
+ CSS rule, for example:
160
+ </ p >
161
+ < code >
162
+ < pre > p strong {
163
+ ...
164
+ }</ pre >
165
+ </ code >
43
166
< p >
44
167
Descendent-selectors are incredibly useful, but if it is written as to
45
168
reflect the HTML structure, it will lead to code that is harder to
0 commit comments