In CSS, conflicts happen when multiple style rules target the same element. The cascade defines how the browser decides which rule wins — based on rule order, specificity, inheritance, and !important. Understanding this hierarchy is essential for effective styling in Nilead’s Visual Editor and custom CSS.
Familiarity with HTML and basic CSS syntax
Access to Nilead’s Style Panel or Custom Code panel
Some experience applying classes, IDs, and selectors
The Cascade is the system by which the browser determines which CSS rule applies when multiple rules target the same element.
Example:
h1 { color: red; }
h1 { color: blue; }<h1>This is my heading</h1>The text appears blue because the second rule comes later and has the same specificity.
Specificity measures how “targeted” a selector is:
Element selectors (h1, p) are least specific
Class selectors (.title) are more specific
ID selectors (#hero) are most specific (excluding !important)
Example:
h1 { color: blue; }
.main-heading { color: red; }<h1 class="main-heading">This is my heading</h1>It will be red, because .main-heading has higher specificity than h1.
The !important declaration overrides all other rules — even if they’re more specific or declared later.
Example:
#winning { background-color: red; }
.better { background-color: gray !important; }<p class="better" id="winning">One selector to rule them all!</p>
This paragraph will be gray, not red — because !important overrides everything else.
Use !important sparingly — it makes CSS harder to debug and override.
Some properties (like color, font-family) are inherited by child elements.
body { color: blue; }All nested text will be blue, unless another rule overrides it.
To control inheritance, CSS offers universal values:
Keyword | Behavior |
|---|---|
inherit | Forces property to match parent |
initial | Resets to browser default |
unset | Behaves like inherit for inheritable properties, initial otherwise |
revert | Reverts to browser/user styles (limited support) |
CSS can be written in three places:
Method | Priority | Example |
|---|---|---|
Inline CSS | Highest (except !important) | <h1 style="color: red;"> |
Internal CSS | Medium | Inside <style> in <head> |
External CSS | Lowest | Linked .css files |
🔥 Order matters — later rules can override earlier ones if they have equal specificity.
Final style = combined result of all applicable rules, resolved in this order (highest to lowest):
Inline styles
Internal stylesheets (in <style> tag)
External stylesheets (linked in <head>)
Browser defaults
Add !important to force a rule to override everything else.
1. What happens if two rules have the same specificity?
The one declared later wins.
2. Does !important beat specificity?
Yes — it overrides specificity and order.
3. Can I override inherited styles?
Yes — just apply a more specific rule or use initial, unset, or inherit.
4. What’s the safest way to organize CSS in Nilead?
Use classes for reusability, and manage overrides via Style Panel or external CSS, not inline.
5. Can I use multiple style sheets?
Yes, but be mindful of load order — stylesheets loaded later can override earlier ones.