XML technologies / CSS / Advanced websites with CSS / Text effects and cascading / Cascading and inheritance in CSS

(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)

The “C” in CSS stands for “cascading”. Cascading has played little part in the chapters and examples so far; now we will examine it closely. All elements on a web page obey the cascade. The following examples explain it mainly through simple, clear text elements.

Inheritance has effects somewhat similar to cascading, but they are entirely different CSS processes. Cascading determines which properties apply when several rules assign values to an element. Inheritance controls how properties pass from parent to child elements.

This sounds complicated but is not. In practice, the two are easy to distinguish. Several simple examples will clarify the difference; then we will examine cascading more closely.

  

  

 

 

 

back to top