CSS stands for Cascading Style Sheet. Can you explain why it is cascading or what rule of CSS makes itself cascading?
From my understanding, cascading means that mutiple style sheets should obey the following rules to apply in order.
Firstly, when both styles apply to exactly the same attributes of one element and the further one has no “!important” , the style closer to the element should override as opposed to those far away. But when the “!important “ occurs or both styles have the “same” distance , the priority of the selectors matters. The style owning the highest priority always wins.
Additionally, the style is inherited. When there is no specific styles applying, applying the global styles.
To summarize, CSS is something like among a set of sheets ,the ones later coming want to cover the former . So the order is critical. The sheets will cascade through all elements until all styles have been decided and applied.
“From my understanding” –> “According to my understanding”
“should override as opposed to those far away” –> “should override the more distant style“
“When there is no specific styles applying, applying the global styles” there must be a subject –> “When there is no specific styles applying, the global styles will apply.“
“CSS is something like among a set of sheets” this is not understandable.
“the ones later coming want to cover the former “ –> “the latter one override the former one”?