How to change compare price background color in predictive search

Topic summary

A user seeks to change the compare price background color specifically in predictive search results, not in product tabs. The store is password-protected (danlo.in, password: hyur5573).

Two solutions provided:

Solution 1 (devcoders):

  • Navigate to: Online Store → Theme → Edit code
  • Open base.css file
  • Add CSS targeting .price-item.price-item--regular with custom background color (#ee9162), padding, border-radius, and white text color

Solution 2 (Made4uo-Ribe):

  • Similar navigation path
  • Modify base.css, style.css, or theme.css
  • Add CSS targeting div#predictive-search-results .price__sale span > s.price-item with red text color, white background, padding, and border-radius

Note: Both responses contain reversed/garbled text in portions of the code and instructions, which may indicate formatting issues. The core CSS approach involves targeting predictive search price elements with custom styling properties.

Summarized with AI on November 5. AI used: claude-sonnet-4-5-20250929.

My Store: danlo.in (password: hyur5573)

How can i change the compare price color and background color in predictive search results. *NOT IN/ON PRODUCTS TAB but in predictive searchs.

2 Likes

Hello @Dan1213

  • Go to Online Store → Theme → Edit code.
  • Find the file base.css and paste the code below at the bottom of the file.
s.price-item.price-item--regular {
color: #fff !important;
background-color: #ee6912;
padding: 2px 4px;
border-radius: 50px;
}

Hi @Dan1213

Try this one,

  1. From your Shopify admin dashboard, click on “Online Store” and then “Themes”.
  2. Find the theme that you want to edit and click on “Actions” and then “Edit code”.
  3. In the “Assets” folder, click on “base.css, style.css or theme.css” file, depending on which file your theme uses to store its CSS styles. At the bottom of the file, add the following CSS code:
div#predictive-search-results div.price__sale > span > s.price-item {
    color: red !important;
    background: white; 
    padding: 2px;
    border-radius: 2px;
}

Your Feedback Matters! Please mark the solution and give likes to posts that helped you. Your appreciation fuels our motivation to assist you better!