Shopify themes, liquid, logos, and UX
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.
Solved! Go to the solution
This is an accepted solution.
Here the problem (section-main-product.css, line 1597):
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:
.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
This is an accepted solution.
Here the problem (section-main-product.css, line 1597):
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:
Thank you so much, it worked! Cheers.
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025