THE ESSENTIAL GUIDE TO CSS AND HTML WEB DESIGN
18
CSS comments look like this: /* this is a comment */, and can be single-line or multipleline.
In the advanced CSS boilerplate, a multiline comment is used for an introduction and
table of contents:
/*
STYLE SHEET FOR [WEB SITE]
Created by [AUTHOR NAME]
[URL OF AUTHOR]
ToC
1. defaults
2. structure
3. links and navigation
4. fonts
5. images
Notes
*/
Each section of the document is then headed by a lengthy comment that makes it obvious
when a section has begun:
/* --------- 1. defaults --------- */
* {
margin: 0;
padding: 0;
}
body {
}
As you can see, property/value pairs and the closing curly bracket are indented by two
tabs in the document (represented by two spaces on this page), which makes it easier to
scan vertically through numerous selectors. (Note that for the bulk of this book, the rules
aren??™t formatted in this way, because indenting only the property/value pairs differentiates
them more clearly in print; however, the download files all have CSS rules indented as per
the recommendations within this section.) Comments can also be used for subheadings,
which I tend to indent by one tab:
/* float-clearing rules */
.separator {
clear: both;
}
Although the bulk of the style sheet??™s rules are empty, just having a boilerplate to work
from saves plenty of time in the long run, ensuring you don??™t have to key in the same
AN INTRODUCTION TO WEB DESIGN
19
1
defaults time and time again.
Pages:
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