5. What is cascading in CSS?

Cascading in CSS refers to the way the browser applies different CSS rules to HTML elements based on specificity, order in the style sheet, and importance (!important). The cascade determines which rules take precedence if there are conflicts.

/* Example of cascading */ p { color: red; /* Rule 1 */ } p { color: blue; /* this rule wins because it is later */ } p.important { color: green !important; /* this rule will win over any other */ }
devFlipCards 2024

Do you accept cookies?

Cookies are small amounts of data saved locally on you device, which helps our website - it saves your settings like theme or language. It helps in adjusting ads and in traffic analysis. By using this site, you consent cookies usage.