However, because this section
will examine CSS rules within certain sections of each style sheet, a brief overview is
required here, too.
Note that in the following sections, there are references to exercises elsewhere in the
book, stating that the code was more or less copied and pasted. In all cases, ensure
you check the paths to any linked files??”mostly, the book has used a totally flat structure
for files. In this chapter, images are always placed in an assets folder. Therefore,
paths to images need updating accordingly when using portions of exercises from
elsewhere in the book.
THE ESSENTIAL GUIDE TO CSS AND HTML WEB DESIGN
372
Essentially, you can use CSS comments for writing notes within a style sheet??”whatever??™s
between CSS comments (which begin /* and end */) is ignored by browsers. Comments
can be multiline or single-line, and you can therefore use comments to create sections in
the style sheet for various ???groups??? of rules. For example, you can use the following to
introduce a group of rules on forms:
/* ---------- forms ---------- */
Taking things further, a multiline comment can be added at the start of the document. This
can include a table of contents, and the various section headers within the style sheet can
be numbered, thereby making navigation and editing even easier. As also explained elsewhere,
I indent both property/value pairs and the closing quote of the declaration, as
shown in the following code block (with a tab being represented by four spaces):
#sidebar {
float: right;
}
This makes it simpler to scan the left-hand side of the document for selectors.
Pages:
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