Element class is secondary behind theme css?

Hi there,

today I used the class entry in an elements customize tab.
It seams, that the theme css overrides some of my css inside that classes.
This does not make sense, doesn’t it?
Is the only way to prevent this to add an !important to every single line of my own css? This would be a really rough solution.
In a perfect world, the class should be overriding the theme css.

Any solution for this issue?
Thank you,
Michael

Hello Michael,

Thanks for writing in! Where did you add your custom CSS? Please be advised that this is the order of the styling being loaded into your site:

  • Theme’s stack style
  • Child theme’s style.css
  • WordPress Additional CSS (Appearance > Customize > Additional CSS)
  • Theme Option Settings
  • Theme Option’s custom CSS
  • Cornerstone or Pro Editor page custom CSS

With the order above, even if you add your custom CSS in the Child theme, theme options or other custom CSS areas will still override it.

Hope this makes sense.

Hello @ruenel,

“Where did you add your custom CSS? " - As I wrote above in my very first sentece:
" I used the class entry in an elements customize tab.” -> Element (e.g. Section) -> Customize -> Class

Is your order ascending, or deascending? And where to put the element custom class?

But to be honest: This does not make sense. If I add a class, I expect that this css is priority one. A user is aware of his classes and all css inside this classes are normally needed.
I do not know, if it is possible to handle a element customize class as priority one, but this makes definitely sense for me.

Thank you,
Michael

Hello Michael,

Even if you add a class entry to an element, and then add something like:

.entry {
  /* some of my styling here */
}

Any styling that applies to that element coming from the style.css or theme options, will also be applied. You might want to check out this first:

Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.