New Shopify Certification now available: Liquid Storefronts for Theme Developers

Different coloured buttons in product description

Solved
PaperMinx
Tourist
8 0 3

I was wanting to add buttons to my product descriptions and I found this old thread (link below) which provided the html to do so. I want to have 3 buttons at the top of the product description (but below the 'add to cart' button) and i'm not sure what changes to the html i would need to do to be able to specify different colours for each one? Currently they are all the same colour -----

Screenshot 2023-10-09 at 1.11.02 pm.png

 

I used the html provided by May in this old thread: https://community.shopify.com/c/shopify-design/how-to-create-a-custom-link-call-to-action-button/td-...

This is the HTML example from the thread that I used to create the buttons. 

 

Screenshot 2023-10-09 at 1.12.14 pm.png

 

Does anyone know what I need to change to be able to have different colours for each of the 3 buttons?

 

Thanks!

Accepted Solution (1)
Dan-From-Ryviu
Shopify Partner
5679 1047 1073

This is an accepted solution.

Hi @PaperMinx 

You can add an inline style to each button example like this to add different color buttons.

<a class="button" style="background-clor: #red;"...>your button name</a>

 

- Helpful? Like and Accept a solution. - Donate: Buy coffee - or Paypal me ❤️
- Ryviu - Product Reviews app, collect consumer photo reviews, import reviews from AliExpress, Amazon, Etsy, Shoppe and Walmart and CSV.
- Lookfy app: Create Image Lookbook, Photo Gallery with product hotspots
- Enjoy 3 months of Shopify for $1/month. Sign up now

View solution in original post

Replies 7 (7)
fadi_yousif
Shopify Partner
315 40 54

You need to target each individual button with CSS selectors. Can you provide the link to your store?

 

Or use inline styles like Dan suggested 😄

Freelance Shopify Developer | Helping Shopify merchants grow with high-converting online stores!
 - Did I help? Leave a tip!
 - Need my help? Chat on Telegram or WhatsApp
 - Was your question answered? Mark it as an Accepted Solution

PaperMinx
Tourist
8 0 3

Thank you. I'll try the inline styles first and if I can't work that out i'll let you know the link and look into CSS selectors. 

Dan-From-Ryviu
Shopify Partner
5679 1047 1073

This is an accepted solution.

Hi @PaperMinx 

You can add an inline style to each button example like this to add different color buttons.

<a class="button" style="background-clor: #red;"...>your button name</a>

 

- Helpful? Like and Accept a solution. - Donate: Buy coffee - or Paypal me ❤️
- Ryviu - Product Reviews app, collect consumer photo reviews, import reviews from AliExpress, Amazon, Etsy, Shoppe and Walmart and CSV.
- Lookfy app: Create Image Lookbook, Photo Gallery with product hotspots
- Enjoy 3 months of Shopify for $1/month. Sign up now

PaperMinx
Tourist
8 0 3

Thank you! I'll give that a try. Do i then remove the colour part of the style coding that I currently have at the bottom of the description. This part...

<style><!--

.button {

   background-color: #f0bfaf;

   color: #ffffff;

   font-size: 14px;

   padding: 5px 14px;

   text-align: center;

   display: inline-block;

   text-decoration: none;

   font-weight:bold;

}

.button:hover {

   background: #f0bfaf;

   color: #fff;

}

--></style>

 

Dan-From-Ryviu
Shopify Partner
5679 1047 1073

Style inline will override the color in that code so you can remove it or not.

- Helpful? Like and Accept a solution. - Donate: Buy coffee - or Paypal me ❤️
- Ryviu - Product Reviews app, collect consumer photo reviews, import reviews from AliExpress, Amazon, Etsy, Shoppe and Walmart and CSV.
- Lookfy app: Create Image Lookbook, Photo Gallery with product hotspots
- Enjoy 3 months of Shopify for $1/month. Sign up now

PaperMinx
Tourist
8 0 3

Oh fantastic, I just tried it and it worked! Thanks so much. 

Dan-From-Ryviu
Shopify Partner
5679 1047 1073

Happy I could help! 

- Helpful? Like and Accept a solution. - Donate: Buy coffee - or Paypal me ❤️
- Ryviu - Product Reviews app, collect consumer photo reviews, import reviews from AliExpress, Amazon, Etsy, Shoppe and Walmart and CSV.
- Lookfy app: Create Image Lookbook, Photo Gallery with product hotspots
- Enjoy 3 months of Shopify for $1/month. Sign up now