Hi, i would like to reduce the space on the sides of the “text” of the button which I have attached in the screenshot below. The space I am talking asbout has been marked with the red arrows. I would like to reduce this space for both of the buttons. Is there a way to do this?
Topic summary
A user wants to reduce the horizontal padding (space on the sides) of button text in their Shopify store, as shown in an attached screenshot with red arrows marking the areas to minimize.
Multiple solutions provided:
-
CSS modifications to base.css file: Add code targeting
.rich-text__buttonswithmax-width: 60%for screens up to 749px wide, or setmin-width: 16remwithflex-grow: unsetfor multiple buttons. -
Custom CSS in theme.liquid: Insert
<style>tags before the closing</body>tag with media queries adjustingmax-widthto 15rem for mobile screens (max-width: 767px).
Implementation steps consistently include:
- Navigate to Online Store → Themes → Edit Code
- Locate either base.css or theme.liquid file
- Paste provided CSS snippet at the specified location
- Save changes
Responders included screenshots showing expected desktop and mobile results. The discussion remains open with no confirmed resolution from the original poster.
@magneticprints please add this css to the very end of your base.css file and check,
Shopify Admin → Online Store ->Theme → Edit code → base.css
@media screen and (maxwidth:749px){
.rich-text__buttons{max-width: 60%;}
}
Hi @magneticprints ,
1, Navigate to Online Store > Themes > Edit Code.
2, Locate and open the base.css file.
3, Paste the code snippet provided below at the bottom of the file, then save your changes.
.rich-text__buttons--multiple>* {
min-width: 16rem!important;
flex-grow:unset!important
}
You will get the result like this
- Mobile
- Desktop
If it helps you, please like and mark it as the solution.
Best Regards
Follow these Steps:
- Go to Online Store
- Edit Code
- Find theme.liquid file
- Add the following code just above tag
If you require further help to optimize your store, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!
Best Regards,
Makka
Hello @magneticprints
You can add code by following these steps
-
Go to Online Store → Theme → Edit code.
-
Open your theme.liquid file
-
Paste the below code before on theme.liquid
Was my reply helpful? Click Like to let me know!
Was your question answered? Mark it as an Accepted Solution.




