13.07.2015 Views

Beginning CSS: Cascading Style Sheets for Web Design, 2nd ...

Beginning CSS: Cascading Style Sheets for Web Design, 2nd ...

Beginning CSS: Cascading Style Sheets for Web Design, 2nd ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Part I: The BasicsElements can also be assigned more than one class name. Figure 3-5 shows an example of this.Figure 3-5The value of this class attribute actually contains two class names: planet and jupiter. Each classname in the attribute is separated by a space. In the corresponding style sheet, the two classes may bereferenced by two separate rules, as illustrated in Figure 3-6.Figure 3-6The two style sheet rules in Figure 3-6 result in the element with both planet and jupiter classnames receiving the declarations of both rules.The class names may also be chained together in the style sheet, as shown in Figure 3-7.Figure 3-7The preceding rule applies only to elements that reference both class names in their class attribute.IE 6 interprets chained class names per the <strong>CSS</strong> 1 specification, which did not allow chained class namesin the style sheet. In IE 6, only the last class name in the chain is recognized. In the preceding example,IE 6 would interpret the .planet.jupiter selector as .jupiter only. This has been fixed in IE 7.Whereas classes are meant to reference more than one element, ids are meant to reference only one elementin a document.62

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!