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.

Chapter 4: The Cascade and InheritanceFigure 4-6cIn Figure 4-6, you see the same example as you saw in Figure 4-4 — two selectors <strong>for</strong> elements with differentbackground declarations. In Figure 4-4, the last selector won because both selectors have the samespecificity. In Figure 4-6, the first selector includes the !important syntax, which causes the cascade to beoverridden, and thus makes the background of both elements in the XHTML document lightblue.The !important rule also takes precedence over the style attribute. Figure 4-7 is an example of this.Figure 4-7aThe <strong>CSS</strong> in Figure 4-7a is combined with the markup in Figure 4-7b.Figure 4-7b119

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

Saved successfully!

Ooh no, something went wrong!