INKLY
July 15, 2024, 3:41pm
1
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
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;
}
Hi @INKLY ,You can follow these steps
Open Online Store > Theme > Edit Code
Find and open the base.css (or theme.css, custom.css) file
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!
INKLY
July 15, 2024, 3:52pm
4
Hi @BSS-TekLabs , thank you for your response, unfortunately I do not get the same resul with you code:
INKLY
July 15, 2024, 3:52pm
5
Hi @namphan , unfortunately that code is not working for me
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;
}
Hi @INKLY ,
I checked and it seems your base.css file is corrupted, can you add the code here ? it will work fine
Hi,
On the product page, click product information,
Scroll to the bottom, and click custom css,
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
INKLY
July 15, 2024, 4:28pm
9
I do have a closing bracket, it still doesn’t work
INKLY
July 15, 2024, 4:32pm
10
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