Change Background color of "Discount" badge

Posted in: Newspaper
Post count: 78

Where to change the background color of this “discount” badge on woocommerce page?

Thanks!

Post count: 78

Also how can i move the badge to the left corner instead?

Thanks!

Post count: 21065

Hello!

For changing background color and moving the badge to the left corner you need to write a css custom code.
You can easily add this code if you access Newspaper -> Theme panel -> Custom code -> Custom CSS:
.woocommerce ul.products li.product .onsale {
top: 0;
right: auto;
left: 0;
background-color: red;
}

For background-color you can choose whatever color you need for the background badge color.

Thank you!

Post count: 78

Hello,

There’s an error next to the first line, following the message shown, I have to use this instead:
.woocommerce .products .product .onsale {

Also it does not change the alignment and color of the badge. I tried this like others suggest on other sites, adding !important on both lines:

right: auto!important;
left: 0!important;
background-color: red;
}

and it is working fine now. I do not know much about CSS codes, is it safe / alright to keep it this way?

Thank you for your help!

Post count: 21065

Hello!

I checked your code also and it’s seems fine and regarding your question, it is alright to keep it in this way.

Thank you!

Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic.