"Cascading" in this context means that because more than one stylesheet declaration could apply to a particular piece of HTML, there has to be a known way of determining which specific stylesheet rule applies to which piece of HTML.
The rule used is chosen by cascading down from the more general declarations to the specific rule required. The most specific declaration is chosen.
Read the official W3C specification on cascading here: https://www.w3.org/TR/css-cascade-4/
"Cascading" in this context means that because more than one stylesheet declaration could apply to a particular piece of HTML, there has to be a known way of determining which specific stylesheet rule applies to which piece of HTML.
The rule used is chosen by cascading down from the more general declarations to the specific rule required. The most specific declaration is chosen.
Read the official W3C specification on cascading here: https://www.w3.org/TR/css-cascade-4/
When I teach CSS, I always tell the students that "cascading style sheets" means something like "fighting style sheets".
One rule tells your H3 tag to be red, another rule tells it to be green -- the rules are contradicting each other, who will win!? Stylesheet deathmatch!
OK maybe that's a slight exaggeration, but it's far more amenable to non-code, non-programming people who are just starting out than any notion of a cascade, or inheritance.
I do of course make sure to tell them that it's not a problem for the style sheets to be fighting each other, that's the way the language was designed.
"Cascading" in CSS
The meaning of cascading - HTML & CSS - SitePoint Forums | Web Development & Design Community
What is CSS (cascading style sheets)?
ELI5:CSS
HTML defines content, CSS decorates it and helps tell how it is displayed.
CSS stands for Cascading Stylesheet. This means that there is a hierarchy of style attributes overwriting other attributes that affect the same elements.
Think of it like this. Bob Ross does an oil painting and starts off with a canvas covered in liquid white. This is the lowest level on the hierarchy. It applies to the entire body of the painting, like a class applied to the body tag.
On that he paints some divs of class "mountain". The mountain class has the attribute paint-color:Van Dyke Brown. Since the div is within body the paint-color:Van Dyke Brown attribute overwrites the liquid white and you see the Van Dyke Brown over the liquid white.
He adds some divs of class "happy little tree" which are growing wherever they like, which happens to be on the mountains, so these happy little tree divs are within the mountain divs. Their paint-color:Sap Green is within the mountain div, so where the happy little tree divs are is painted with Sap Green on top of the Van Dyke Brown mountains.
Then Bob adds another happy little tree div. This one he wants to be Alizarin Crimson because its his world and it can be whatever fucking color he god damn pleases. Rather than giving it a special id and using the # selector Bob makes the happy little accident of using an inline style. This overwrites the happy little tree class's paint-color:Sap Green attribute with an inline paint-color:Alizarin Crimson because inline styles cascade over classes.
More on reddit.comVideos
I'm just beginning to learn CSS and wanted to know what cascading meant. From what I can understand I think it's referring to how CSS decides which rule to apply to a certain element if they overlap. Like if I declare that I want h1 to be red, then say it should be green, it will pick red first, and then ultimately choose green. But I could be entirely wrong on this, can someone correct me if I am and put it into better words?