Commit 100b79d James Halliday
committed
1 parent 22171ed commit 100b79d Copy full SHA for 100b79d
File tree 1 file changed +37
-0
lines changed
1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -227,10 +227,47 @@ use a class when there could be many elements
227
227
228
228
view the source on http://cyber.wizard.institute & explore
229
229
the stylesheet.
230
+ ---
231
+ # css selectors
232
+
233
+ You can create blocks of css rules that apply to more than
234
+ just individual classes and ids with css selectors.
235
+
236
+ ``` css
237
+ #page .row .title {
238
+ color : cyan ;
239
+ }
240
+ ```
230
241
242
+ will match ` <div class="title"></div> ` in:
243
+
244
+ ``` html
245
+ <div id =" page" >
246
+ <div class =" row" >
247
+ <div class =" header" >
248
+ <div class =" title" ></div >
249
+ <div class =" date" ></div >
250
+ <div class =" author" ></div >
251
+ </div >
252
+ </div >
253
+ </div >
254
+ ```
231
255
---
256
+ # css selectors
232
257
258
+ We just used spaces between elements in ` #page .row .title ` ,
259
+ but we can do lots of other things with css:
233
260
261
+ * ` E ` - match an element E by its tag name (example: ` h1 ` )
262
+ * ` E F ` - matches F, a descendant of E
263
+ * ` E > F ` - matches F, a direct child of E
264
+ * ` E#abc ` - matches an element E with an id of abc
265
+ * ` E.xyz ` - matches an element E with a class of xyz
266
+ * ` E[foo="bar"] ` - match an element E with an attribute
267
+ ` foo ` equal to "bar"
268
+
269
+ and more! http://www.w3.org/TR/CSS2/selector.html#pattern-matching
270
+ ---
234
271
# neocities
235
272
236
273
You can host your html on neocities for free!
You can’t perform that action at this time.
0 commit comments