Shopify themes, liquid, logos, and UX
Hi,
How do I change the add to cart button size to make it smaller? OR how do I just make it smaller on mobile? when views on mobile the button is cut off due to the size. Below is a reference photo from dekstop.
Solved! Go to the solution
This is an accepted solution.
Hi @TPennell.
You can add the following code at the bottom of your base.css
@media screen and (max-width: 749px) {
.product-form-buttons > *:not(.quantity-selector) {
flex: unset!important;
margin: 0 auto!important;
}
}
The result should be:
I hope this helps!
If your question was answered, please mark it as an Accepted Solution
Hi @TPennell. Welcome to the Shopify Community!
It can be done with an additional CSS rule. Can I see an URL with the button?
This is an accepted solution.
Hi @TPennell.
You can add the following code at the bottom of your base.css
@media screen and (max-width: 749px) {
.product-form-buttons > *:not(.quantity-selector) {
flex: unset!important;
margin: 0 auto!important;
}
}
The result should be:
I hope this helps!
If your question was answered, please mark it as an Accepted Solution
Lovely stuff Nina,
just for future proofing - Do you know of a way to adjust the size with a percentage? just incase, in future, I wish to play around with it a little more? If not, no problemo!
(Below example if in future, I wanted 2 per line etc)
Glad that it helped!
This is a flexbox, you can't really adjust it with percentages. Once the issue pops up, just post it on the forums, it won't be difficult to solve 🙂
Great stuff - Appreciate your time and help
Anytime! Glad I could help!
Hi @TPennell
Could you share the link to your store?
- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- 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.
- Enjoy 1 month of Shopify for $1. Sign up now.
Hello @TPennell
Go to online store ----> themes ----> actions ----> edit code ----> base.css
add this code at the end of the file and save.
.product-form-buttons button {
width: 80%;
margin: 0 auto !important;
}
result
If this was helpful, hit the like button and accept the solution.
Thanks
Hi GTL,
thanks for the reply.
Have entered this in the base.css as below, saved and nothing has changed. Apologies if I am missing something.
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025