In my site's child theme some changes only take effect if I use !important. Is this proper procedure or is it more of a workaround? Is there a better technique more in line with best practices?
Asked
Active
Viewed 104 times
0
-
1Could help: http://stackoverflow.com/questions/3706819/what-are-the-implications-of-using-important-in-css – nikoskip Mar 24 '16 at 04:43
-
Very helpful! Thanks – tensormoby Mar 24 '16 at 05:00
1 Answers
1
It certainly isn't best practice, you'll probably want to look into specificity in CSS.
If you have a Child theme you may want to give it a body
class of say my-child-theme
, then in your child theme CSS you can do;
.my-child-theme .child-theme-element { background: pink }
without the need for using !important

itsphilz
- 455
- 2
- 9