Why is my add to cart button color not changing to red?

I successfully changed the color of my add to cart button a long time ago to green by using the code:

.btn–add-to-cart {
background: green
border: none
color: white
}

But when I try to put a different color in the background (red), it is still stuck on green. I want it to be red.

.btn--add-to-cart {
    background: red !important;
    border: none;
    color: white;
}

Hi Space-Es, thanks for your reply. I have added this code, replacing my current one, but the add to cart button is still green. I think my store/theme may be glitched in some way in terms of the coding. Could there be another possible solution to this?

The problem is probably the class name (.btn–add-to-cart). Can you give me the link to your store and tell me which button exactly you want to change? This would help me a lot in determining which class needs to be modified.

My store is veraquil.com

The button I want to change is the add to cart button when you go on any product page.

Thanks

1 Like

Here the problem (section-main-product.css, line 1597):

2.PNG

The current code in your css file prevents any changes you make from the base.css due to the ‘!important’ attribute. Please delete it and add something like this for example:

.product-form__buttons .product-form__submit {
    color: #fff;
    background: darkblue;
}

Result:

1 Like

Thank you so much, it worked! Cheers.

1 Like