My button Does not have a background colour. Theme Be Yours

Solved

My button Does not have a background colour. Theme Be Yours

AdamR1983
Tourist
6 0 4

Hi!

 

I am trying to add call-to-action buttons and when I do they have no background colour.

Can anyone spot the error or issue?

Custom CSV is

.button-container {
text-align: center; /* Centers the buttons horizontally */
margin-top: 20px; /* Optional: Adds some space above the buttons */
}

.btn {
padding: 10px 20px;
background-color: #f51d97; /* Pink background */
color: #fff; /* White text */
text-decoration: none;
border-radius: 5px;
display: inline-block;
margin: 10px 0; /* Adds some vertical space between buttons */
}

In Custom Liquid:
<div class="button-container">
<a class="btn" href="REMOVED">Click to email</a>
<a class="btn" href="REMOVED">Click to Call</a>
<a class="btn" href="REMOVED">Click to WhatsApp</a>
<a class="btn" href="REMOVED">Click to Send a Message</a>
</div>



Accepted Solution (1)

BSS-TekLabs
Shopify Partner
2350 702 828

This is an accepted solution.

- Here is the solution for you @AdamR1983 
- Please follow these steps:

z5686811214059_e66de1953f1db631f9134af5cdb796ad.jpg

- Then find the theme.liquid file.
- Then add the following code at the before tag </head> and press 'Save' to save it.

<style>
.btn {
background-color: #f51d97 !important;
}
</style>

 

- Please press 'Like' and mark it as 'Solution' if you find it helpful. Thank you.

If our suggestions are useful, please let us know by giving it a like or marking it as a solution.


Salepify: Efficiently increase sales conversion with sale-driven features like auto add to cart, free gifts (free plan available)


Salemate: Boost your AVO with 2-layer offer, countdown upsell in your post purchase page


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

View solution in original post

Replies 11 (11)

BSS-TekLabs
Shopify Partner
2350 702 828

This is an accepted solution.

- Here is the solution for you @AdamR1983 
- Please follow these steps:

z5686811214059_e66de1953f1db631f9134af5cdb796ad.jpg

- Then find the theme.liquid file.
- Then add the following code at the before tag </head> and press 'Save' to save it.

<style>
.btn {
background-color: #f51d97 !important;
}
</style>

 

- Please press 'Like' and mark it as 'Solution' if you find it helpful. Thank you.

If our suggestions are useful, please let us know by giving it a like or marking it as a solution.


Salepify: Efficiently increase sales conversion with sale-driven features like auto add to cart, free gifts (free plan available)


Salemate: Boost your AVO with 2-layer offer, countdown upsell in your post purchase page


BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now
AdamR1983
Tourist
6 0 4

This is super helpful!
Now the background is pink but the text is not centered and black. Any idea?

BSS-TekLabs
Shopify Partner
2350 702 828
<style>
.btn {
background-color: #f51d97 !important;
    text-align: center !important;
    color: #fff !important;
}
</style>

Can you try replace to this code @AdamR1983 

If our suggestions are useful, please let us know by giving it a like or marking it as a solution.


Salepify: Efficiently increase sales conversion with sale-driven features like auto add to cart, free gifts (free plan available)


Salemate: Boost your AVO with 2-layer offer, countdown upsell in your post purchase page


BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now
AdamR1983
Tourist
6 0 4

ADD URL https://medicetics.com/pages/book-now

Semi working! The text is different and not centred with the below code 
<style>
.btn {
background-color: #E5016E !important;
color: #fff !important;
text-align: center !important;
display: flex;
align-items: center;
justify-content: center;
height: 100%; /* Ensure the button has a defined height or is part of a layout that constrains its height */
}
</style>

AdamR1983_0-1725978511511.png

 

 

BSS-TekLabs
Shopify Partner
2350 702 828

 

<style>
.btn {
background-color: #f51d97 !important;
    text-align: center !important;
    color: #fff !important;
    align-items: center !important;
justify-content: center !important;
}
</style>

 

Can you try this code @AdamR1983 

- Please press 'Like' and mark it as 'Solution' if you find it helpful. Thank you.

If our suggestions are useful, please let us know by giving it a like or marking it as a solution.


Salepify: Efficiently increase sales conversion with sale-driven features like auto add to cart, free gifts (free plan available)


Salemate: Boost your AVO with 2-layer offer, countdown upsell in your post purchase page


BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now
AdamR1983
Tourist
6 0 4

Sent a meeting request from the help today, but again thanks!!

Okay so it's not centred 
<style>
.btn {
background-color: #E5016E !important;
color: #fff !important;
text-align: center !important;
display: flex;
align-items: center !important;
justify-content: center !important;
height: 100%;
font-weight: bold; /* Makes the text bold */
}
</style>

AdamR1983_0-1725979861798.png

 

BSS-TekLabs
Shopify Partner
2350 702 828

Can you share your store url?

If our suggestions are useful, please let us know by giving it a like or marking it as a solution.


Salepify: Efficiently increase sales conversion with sale-driven features like auto add to cart, free gifts (free plan available)


Salemate: Boost your AVO with 2-layer offer, countdown upsell in your post purchase page


BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now
AdamR1983
Tourist
6 0 4
BSS-TekLabs
Shopify Partner
2350 702 828
<style>
.btn {
background-color: #f51d97 !important;
    text-align: center !important;
    color: #fff !important;
    align-items: center !important;
justify-content: center !important;

padding: 0px 20px !important;
    height: 40px !important;
    line-height: 40px !important;
}
</style>

Can you try this code @AdamR1983 

If our suggestions are useful, please let us know by giving it a like or marking it as a solution.


Salepify: Efficiently increase sales conversion with sale-driven features like auto add to cart, free gifts (free plan available)


Salemate: Boost your AVO with 2-layer offer, countdown upsell in your post purchase page


BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now
BSS-TekLabs
Shopify Partner
2350 702 828

BSSTekLabs_0-1725980503156.png

 

If our suggestions are useful, please let us know by giving it a like or marking it as a solution.


Salepify: Efficiently increase sales conversion with sale-driven features like auto add to cart, free gifts (free plan available)


Salemate: Boost your AVO with 2-layer offer, countdown upsell in your post purchase page


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

Tech_Coding
Shopify Partner
334 91 82

Hello @AdamR1983 
replace this css
.btn {
padding: 10px 20px;
background-color: #f51d97; /* Pink background */
color: #fff; /* White text */
text-decoration: none;
border-radius: 5px;
display: inline-block;
margin: 10px 0; /* Adds some vertical space between buttons */
}

And add this CSS:
.btn {
padding: 10px 20px;
background-color: #f51d97 !important; /* Pink background */
color: #fff !important; /* White text */
text-decoration: none;
border-radius: 5px;
display: inline-block;
margin: 10px 0; /* Adds some vertical space between buttons */
}

my reply helpful? Click Like to let me know!
your question answered? Mark it as an Accepted Solution.

my reply helpful? Click Like to let me know!
your question answered? Mark it as an Accepted Solution.
Shopify UI Developer
Your Coffee Tips adds a little sweetness to my day.