How To Change Sale Badge Color To Red In Refresh Theme Mobile

I need help changing the color of the discount badge on mobile, I entered the following code to change it on desktop:

.card__badge .badge{
    font-size: 13px;
    background-color: red;
    font-weight: bold;
  }

  .price .price__badge-sale {
    font-size: 13px;
    background-color: red;
    font-weight: bold;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

But in mobile is not working, can anyone help me?

Hey @KhallP ,

Please replace the previous CSS code with the code provided below and verify:

/* For Desktop */
.card__badge .badge,
.price .price__badge-sale {
	font-size: 13px;
	background-color: red;
	font-weight: bold;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}

/* For Mobile */
@media only screen and (max-width: 767px) {
	.card__badge .badge,
	.price .price__badge-sale {
		background-color: red;
	}
}

Thank You.

Still not working in mobile…

Hey @KhallP ,

It is working correctly at my end.

Could you please again check where you placed the code? Or, if it still doesn’t work, you can replace the previous codes with the code provided below:

/* For Desktop */
.card__badge .badge,
.price .price__badge-sale {
	font-size: 13px;
	background-color: red !important;
	font-weight: bold;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}

/* For Mobile */
@media only screen and (max-width: 767px) {
	.card__badge .badge,
	.price .price__badge-sale {
		background-color: red !important;
	}
}

Thank You.

That´s so strange

.card__badge .badge,
.price .price__badge-sale {
	font-size: 13px;
	background-color: red !important;
	font-weight: bold;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}

/* For Mobile */
@media only screen and (max-width: 767px) {
	.card__badge .badge,
	.price .price__badge-sale {
		background-color: red !important;
	}
}
}

Hey @KhallP ,

Can you please clarify how and where you placed the provided code?

Thank You.

I insert the code in the bottom of “base.css” file

Hey @KhallP ,

Could you please try adding this to Global Custom CSS?

Steps:

  1. In your Shopify admin, go to Online Store > Themes.
  2. Click Customize.
  3. Click Theme settings.
  4. Click Custom CSS.
  5. Add your code.
  6. Click Save and Verify.

Thank You.

Still Not Working Bro, That´s so Strange

OK, now it worked, I didn’t understand that you said to put MY code

Hey @KhallP , there seems to be a conflict in CSS.

Glad it worked for you @KhallP ! :blush: