How can I center text inside buttons on my webpage?

Hi

how can I center text inside buttons. Currently its like

3.png

I want it to be like

3.png

my code is


Search by Tags:

{% for tag in product.tags %} {{ tag }} {% endfor %}

.product_tags a.link { color: #000000; background: #FFFFFF; border: 1px solid #000000; border-radius: 3px; min-width: 35px; min-height: 35px; padding: 0 9px; margin-bottom: 5px; line-height: 18px; } .product_tags a.link:hover { background-color: #42bbec; color: white; } }
1 Like

@amazezones

Sorry you are facing this issue, it would be my pleasure to help you.

Welcome to the Shopify community! :blush:
Thanks for your good question.

Please share your site URL,
I will check out the issue and provide you a solution here.

Hello,

To solve this issue you can add to the “.product_tags a.link” code bellow:

display: flex;
justify-content: center;
align-items: center;
Or you can replace your code from to with code bellow (it already updated)

.product_tags a.link { color: #000000; background: #FFFFFF; border: 1px solid #000000; border-radius: 3px; min-width: 35px; min-height: 35px; padding: 0 9px; margin-bottom: 5px; line-height: 18px; display: flex; justify-content: center; align-items: center; } .product_tags a.link:hover { background-color: #42bbec; color: white; } }

It should be enough.
If my answer can help you solve your issue, please mark it as a solution. Thank you and good luck.

It works… but now each buttons are in 1 line…

what I want is like

Screen Shot 2022-06-04 at 11.34.33 AM.png

Hello,

I adjusted the code, and now your buttons will looks like on screenshot below:


1 Like