HTML5 and CSS 3 – Illustrated 2nd Ed. Instructor’s Manual: Unit C Page 3 of 14
TEACHER TIP
Make sure that students are aware that one style rule can include multiple selectors. For
example, in order to apply the same formatting information to all header sizes, there is no need
to write six different style rules. Rather, a single style rule including six type selectors is
appropriate, and would look like this:
h1, h2, h3, h4, h5, h6 {
attribute-value pairs
}
• Point out that CSS supports attributes for many different aspects of HTML formatting and
presentation, and that multiple attributes can be defined for each formatting area. Allowable
values are specific to each attribute, and vary widely between attributes.
TEACHER TIP
Point out that the correct values for a specific attribute can be looked up online in CSS
references such as www.w3c.org
FIGURES: C-1, C-2
TABLE C-1: CSS properties and values
BOXES:
1. Quick Tip: Appendix B provides a reference for many commonly used CSS properties and
their values.
2. Quick Tip: To learn more about a specific CSS property, you can look it up in an online CSS
reference such as the one at developer.mozilla.org/en-US/docs/Web/CSS/Reference.
3. Clues to Use: Spacing your CSS code
Web page rendering engines recognize attribute-value pairs after a selector as starting after
an opening curly brace { and ending with the closing curly brace }. As long as a semicolon
follows each value, any number of spaces, tabs, and new lines can occur within a set of
attribute-value pairs. As a result, the appearance of CSS code can vary widely. Most
developers prefer to give each declaration its own line, often indented beneath its selector,
as shown in FIGURE C-1, to make the code easier to read. Others prefer to keep all
CLASSROOM ACTIVITIES
1. Critical Thinking: Ask students to think of reasons why it is helpful and important to use CSS to
format a web page rather than using HTML formatting elements. Specifically, they should compare
websites containing a single page compared to websites containing multiple pages.