Need help with adding/removing CSS class to elements


I am wanting to add a class to the button on a web page we have created so I can customise it. I have selected the element within the widget (internal link element) gone to advanced and added my Customer CSS class. I have added CSS to my theme, that modifies the link container but does not remove or overwrite the built in Internal link CSS. I now basically have my custom CSS with the default bootstrap button in the middle…

Is there away of removing or overwriting the btn class or adding a customise class to the element?

Hi WIlliam,

If you want to change any of the default settings for a style, you make your css more specific - so if you have a class like “myclass” added to the button, your css should include something like:

.myclass.btn {

HOWEVER, it looks to me like some of the button classes (like .bg-light) have the !important modifier applied so will prevent you setting them up as more specific.

The following worked for me:

.myclass {
background-color: green !important;

This uses both a more specific selector and !important.


1 Like

You sir are a champ!

That’s worked, cant believe i missed the !important,

Thanks for your help.