Shopify themes, liquid, logos, and UX
Dear
Good day
I tried to add "Order on WhatsApp" button in my store. But there is some problem I am facing to adjust button size for desktop and mobile. If I set a width its showing different width in desktop and mobile. Check below code:
///////////////////////////////////////////////////////////////////////
@media only screen and (min-width: 750px) {
.btn--buy-on-whatsapp {
width: 360px;
display: block;
margin-top: 25px;
padding: 12px 30px;
font-size: 16px;
line-height: 1.5;
color: #fff;
background-color: #25d366;
border: 1px solid #4e4e4e;
border-radius: 100px;
text-align: center;
text-decoration: none;
text-transform: capitalize;
transition: all 0.3s ease;
}
.btn--buy-on-whatsapp:hover {
background-color: #fff;
color: #4e4e4e;
border-radius: 100px;
}
}
@media only screen and (max-width: 750px) {
.btn--buy-on-whatsapp {
width: 328px;
display: block;
margin-top: 25px;
padding: 12px 30px;
font-size: 16px;
line-height: 1.5;
color: #fff;
background-color: #25d366;
border: 1px solid #4e4e4e;
border-radius: 100px;
text-align: center;
text-decoration: none;
text-transform: capitalize;
transition: all 0.3s ease;
}
.btn--buy-on-whatsapp:hover {
background-color: #fff;
color: #4e4e4e;
border-radius: 100px;
}
}
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Check the above images. The width not matching with other button.
Help me on this matter to fix it.
Thanks
Solved! Go to the solution
This is an accepted solution.
You can solve it by updating your code to this version
.btn--buy-on-whatsapp {
width: 100%;
max-width: 44rem;
display: block;
display: block;
margin-top: 25px;
padding: 12px 30px;
font-size: 16px;
line-height: 1.5;
color: #fff;
background-color: #25d366;
border: 1px solid #4e4e4e;
border-radius: 100px;
text-align: center;
text-decoration: none;
text-transform: capitalize;
transition: all 0.3s ease;
}
.btn--buy-on-whatsapp:hover {
background-color: #fff;
color: #4e4e4e;
border-radius: 100px;
}
- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...Sign up now.
Please share store url without url we can't help you!
This is an accepted solution.
You can solve it by updating your code to this version
.btn--buy-on-whatsapp {
width: 100%;
max-width: 44rem;
display: block;
display: block;
margin-top: 25px;
padding: 12px 30px;
font-size: 16px;
line-height: 1.5;
color: #fff;
background-color: #25d366;
border: 1px solid #4e4e4e;
border-radius: 100px;
text-align: center;
text-decoration: none;
text-transform: capitalize;
transition: all 0.3s ease;
}
.btn--buy-on-whatsapp:hover {
background-color: #fff;
color: #4e4e4e;
border-radius: 100px;
}
- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...Sign up now.
Thank you so much brother.
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025