Shopify themes, liquid, logos, and UX
Hi, I would like to center the text inside the add to cart button. But I'm not sure which css does that. Does anyone know how to achieve this result? Thank you for your help.
Store URL: https://inkly.fr/?_ab=0&_fd=0&_sc=1&preview_theme_id=163175923977
Solved! Go to the solution
This is an accepted solution.
Hi @INKLY,
Please go to Actions > Edit code > Assets > base.css file and paste this at the bottom of the file:
.product-form__submit>span {
display: flex;
align-items: center;
gap: 5px;
}
This is an accepted solution.
Hi @INKLY,
I checked and it seems your base.css file is corrupted, can you add the code here? it will work fine
This is an accepted solution.
Hi @INKLY,
Please go to Actions > Edit code > Assets > base.css file and paste this at the bottom of the file:
.product-form__submit>span {
display: flex;
align-items: center;
gap: 5px;
}
This is an accepted solution.
Hi @INKLY,
I checked and it seems your base.css file is corrupted, can you add the code here? it will work fine
Thank you, it worked ! However, what do you mean by my base.css file is corrupted and how can I fix that? Thank you for your help !
Hi @INKLY,
Because when I tested, you can't add code at the end of the file, it won't read the code.
If you want, I'll send you a contributor invite and check it out
Hi @INKLY,You can follow these steps
1. Open Online Store > Theme > Edit Code
2. Find and open the base.css (or theme.css, custom.css) file
3. Paste the code snippet below at the bottom of the file and hit save
.product-form__submit.button span {
display: flex;
justify-content: center;
align-items: center;
gap: 10px;
}
Here is the result
Hope this helps you solve the issue.
Please don't forget to Like and Mark it as an Accepted Solution if you find this helpful. Thank you!
For give Gift to customers and Upsell in Cart, check out Salepify: Free Gifts with purchase
Post purchase upsell, downsell offers to improve sales and AOV
Salemate Post Purchase Upsell
Hi @BSS-TekLabs, thank you for your response, unfortunately I do not get the same resul with you code:
I've checked your site, it is because you don't have a closing bracket. Just add the code below to the end of the base.css file
}
.product-form__submit.button span {
display: flex;
justify-content: center;
align-items: center;
gap: 10px;
}
For give Gift to customers and Upsell in Cart, check out Salepify: Free Gifts with purchase
Post purchase upsell, downsell offers to improve sales and AOV
Salemate Post Purchase Upsell
I do have a closing bracket, it still doesn't work
Hi,
1. On the product page, click product information,
2. Scroll to the bottom, and click custom css,
3. copy and paste the code;
.product-form__buttons {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
You can remove edit code and remove the class button--full-width class on the add to cart button, the class makes sure the add to cart button spans full width 100%.
The class also gives the button its color.
check out this blog for more info.
How to Center Anything with CSS - Align a Div, Text, and More
Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024The Hydrogen Visual Editor is now available to merchants in Shopify Editions | Summer '...
By JasonH Sep 2, 2024Note: Customizing your CSS requires some familiarity with CSS and HTML. Before you cust...
By JasonH Aug 12, 2024