0

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?

j08691
  • 204,283
  • 31
  • 260
  • 272
tensormoby
  • 45
  • 6

1 Answers1

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