0

hi guys im trying to overwrite the styles on our wp plugin and style it in our own style sheet is there a way to do this? ive tried making classes for them in the style sheet with the same name as the plugin, ive also tried using !improtantafter... here is what it looks like in dev console.enter image description here

and this is the code i used to try and overwrite the css for the plugin.

#ai20 h3{ font-weight:bold!important; }

also ive added this just to make sure and still nothing.

.statistics h3 { font-weight:bold!important; }

i have no clue why its not updating the css if anyone can give me a have i would be much appreciated.

2 Answers 2

2

The new rule you wrote has not been applied, as you can see in the screenshot you posted, so check the CSS file you added it to and make sure:

  1. That CSS file is linked correctly
  2. The style is not nested in some other rule
  3. The CSS file is not cached (hard refresh)

You can use a custom CSS plugin, a child theme or simple add you overwriting rule to the end of your main CSS file within the editor in Wordpress.

Also, the ID will take precedence over the class, even if the class comes after it. Why are you trying to override with the same property/value?

Once the rule is being correctly applied, this will work fine:

.statistics h3 { font-weight:bold }
Sign up to request clarification or add additional context in comments.

2 Comments

thanks mate, im quite new to coding so some things im still getting there with, i used a custom css plugin and its working fine now! cheers. think there is a problem with our css as none of our updates are working... flm thanks tho!
Sure. If you check the outputted page and your CSS file is not there, check the source to see why, if it's there but your rules aren't there check it's being saved and not cached.
1

Use the plugin https://nl.wordpress.org/plugins/simple-custom-css/ it automatically overwrites your current css and adds the new one, I always use it! All you have to do is call the id or class you want to style in the plugin and style it as you normally would.

1 Comment

Glad to help @JamesClapson

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.