WHAT YOU WILL LEARN IN THIS CHAPTER:
In Chapter 3, I discussed the various types of selectors that CSS supports. In this chapter, now that you have an understanding of some of the basic nuts and bolts that make up CSS, you continue along that path with the cascade and inheritance. In CSS, inheritance and the cascade are as fundamental as selectors, lengths, and properties. In fact, the importance of precedence is implied by the name of the language itself: Cascading Style Sheets.Cascading is a term used to describe precedence. Because a single element may be matched by multiple CSS declarations, the CSS specification includes a set of guidelines defining which declarations can take precedence over others and how this is decided.
Style sheets can come from more than one place. A style sheet can originate from any of the following sources:
Because a style sheet can originate from more than one source, it is necessary to establish an order of precedence to determine in which order style sheets apply styles for the page the user is seeing. The ...