HTML and CSS Reference
In-Depth Information
Three selectors, h1 , h2 , and h3 , are grouped together. The declaration block en-
closed in curly braces sets the color property to blue . Whenever any one of the h1 ,
h2 , or h3 elements is used in the document, its text will be blue.
The declaration block for the h1 selector consists of a group of properties and val-
ues to further define the font style for this heading.
The font property, in this example, groups the font values as a list, rather than cre-
ating individual property/value pairs as done on line 2.
Now the h1 tag is tested to see if the style was applied, and it is!
The style for the h2 tag is tested and it has been applied.
The only style set for the h3 tag is a blue font, and that's all we get, as shown in
Figure 14.2.
Figure 14.2 Grouping selectors and declarations for h1 , h2 , and h3 HTML elements.
14.4 Common Style Sheet Properties
In the previous examples, font-family and color are properties (also called attributes),
and assigning values to them defines the style of the document. Listed in Table 14.1 are
some of the properties commonly used in style sheets. Many of these properties are used
in the style sheets defined throughout this chapter and later as properties of the style
object used with JavaScript. The Web Design Group provides a complete listing of this
information at .
Search WWH ::

Custom Search