3 ms·
This is misleading, !important is not required to use inline styles. They still cascade normally like CSS classes... see this example: <div style="color:
by gitgud 6y ago
This is misleading, !important is not required to use inline styles.
They still cascade normally like CSS classes... see this example:
<div style="color: red">
<p>red text</p>
<p>red text</p>
<p style="color: blue">blue text</p>
</div>
Ironically, it's actually complex CSS classes and long selectors that produce high specificity, which then requires even more specificity to override and eventually the dreaded !important
- SahAssar 6y agoThe parent is not talking about inheritance. They are talking about specificity.
- cosmotic 6y agoIf an element has a style attribute that sets the color, it will override every single CSS/Style-element style that also sets the color, unless the CSS/Style-element style also includes an !important.