My sale badge is not centred with price (dawn theme)

Solved

My sale badge is not centred with price (dawn theme)

sunny96x
Explorer
49 0 18

As seen in the screenshot below, the sales badge is aligned to the top, how can i make it aligned to the middle so it sits perfectly in line with the price?

 

Screenshot 2024-09-28 002947.png

website: https://shopstellory.com/products/sticky-inserts

Accepted Solution (1)
BSSCommerce-B2B
Shopify Partner
1718 512 575

This is an accepted solution.

@sunny96x, Change the previous code like this

<style>
.product .price .badge, .product .price__container {
   margin-bottom: 0!important
}
.price.price--large.price--on-sale.price--show-badge {
   display: flex;
   align-items: center
}
</style>

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

View solution in original post

Replies 6 (6)

BSSCommerce-B2B
Shopify Partner
1718 512 575

@sunny96x ,

Step 1: Go to Admin -> Online store -> Theme > Edit code

Step 2: Search for the file theme.liquid

Step 3: Add this code before </body> tag

<style>
.product .price .badge, .product .price__container {
   margin-bottom: 0!important
}
</style>

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

BSSCommerce-B2B
Shopify Partner
1718 512 575

Here is the result for you 

BSSCommerceB2B_0-1727455276073.png

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

sunny96x
Explorer
49 0 18

Hi, it's a little bit better now but still not perfect - I should have mentioned before that the price is a bigger font size than the SAVE 30% text.

 

sunny96x_0-1727455498692.png

 

BSSCommerce-B2B
Shopify Partner
1718 512 575

This is an accepted solution.

@sunny96x, Change the previous code like this

<style>
.product .price .badge, .product .price__container {
   margin-bottom: 0!important
}
.price.price--large.price--on-sale.price--show-badge {
   display: flex;
   align-items: center
}
</style>

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

sunny96x
Explorer
49 0 18

Thank you so much brother!

Gracie_Sandra
Shopify Partner
7 1 1

To center the sale badge with the price in the Dawn theme, you’ll need to adjust the CSS. Here’s how:

  1. Go to the CSS File:

    • Navigate to Online Store > Themes > Actions > Edit code.
    • Find the file named base.css (usually under the Assets folder).
  2. Add Custom CSS:

    • Scroll to the bottom of the base.css file and add the following code:

      css
      Copy code
      .price__badge-wrapper { display: flex; align-items: center; justify-content: center; } .price__sale-badge { margin: 0 auto; }
  3. Save and Preview:

    • Click Save and then preview your store to see if the sale badge is now centered.

If it still doesn’t align perfectly, you may need to tweak the margin or padding values to fit your specific design.

Feel free to reach me out if my idea has helped you or you don't understand