Commit 22171ed James Halliday
committed
1 parent fc2e907 commit 22171ed Copy full SHA for 22171ed
File tree 1 file changed +39
-3
lines changed
1 file changed +39
-3
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ http://www.w3schools.com/html/html_css.asp)
152
152
153
153
---
154
154
155
- # styles per class
155
+ # styles per element
156
156
157
157
``` html
158
158
<html >
@@ -179,12 +179,48 @@ h1 {
179
179
180
180
---
181
181
182
- # styles for id's
183
-
182
+ # styles for ids
184
183
184
+ use an id when there will only be a single element
185
185
186
+ ``` css
187
+ <html >
188
+ <head >
189
+ <style >
190
+ #msg {
191
+ font-weight : bold ;
192
+ font-size : 72px ;
193
+ color : magenta ;
194
+ }
195
+ </style >
196
+ </head >
197
+ <body >
198
+ <div id="msg"> wow!</div >
199
+ </body >
200
+ </html >
201
+ ```
202
+ ---
203
+ # styles for class
186
204
205
+ use a class when there could be many elements
187
206
207
+ ``` css
208
+ <html > <head >
209
+ <style >
210
+ .msg {
211
+ font-weight : bold ;
212
+ font-size : 72px ;
213
+ color : magenta ;
214
+ }
215
+ </style >
216
+ </head >
217
+ <body >
218
+ <div class="cool"> wow!</div >
219
+ <div class="cool"> neat!</div >
220
+ <div class="cool"> super!</div >
221
+ </body > </html >
222
+ ```
223
+ ---
188
224
# external style sheets
189
225
190
226
`<link rel="stylesheet" href="style .css"> `
You can’t perform that action at this time.
0 commit comments