If
you??™re familiar with the concept of using styles in a word processing program, you??™ll have no trouble grasping
style sheets.
Here??™s how the process works: CSS instructions are given in rules; a style sheet is a collection of these rules.
A rule is a statement made up of an HTML or custom style, called a selector, and its defined properties and
values. For example, a CSS rule that makes the contents of all
tags (the selector) red (#FF0000 in
hexadecimal, the value) in color (the property) looks like the following:
h1 {
color: #FF0000;
}
A CSS property and its associated value are collectively referred to as a declaration.
In the following sections, you see the various characteristics of CSS??”grouping, inheritance, and
cascading??”working together to give style sheets their flexibility and power.
Grouping properties
A Web designer often needs to change several style properties at once. CSS enables you to group declarations
by separating them with semicolons. For example:
h1 {
color:#FF0000;
font-family:Arial,Helvetica,sans-serif;
font-size:18pt;
}
The Dreamweaver interface provides a wide range of options for styles. If you look at the code, you find
that Dreamweaver groups your selections exactly as shown in the preceding example.
Pages:
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463