Re: How can I give my custom Button the same css properties like add to cart button?

Solved

How can I give my custom Button the same css properties like add to cart button?

NoahOnyejese
Excursionist
29 0 6

Hi guys I added a custom liquid under my add to cart button on the Shopify product page of the Dawn Theme. I coded a button but I don't know how to make the CSS properties of my new one the same as the add-to-cart button.

 

I tried giving it the same class but it didn't work. Only the width is wrong.

 

NoahOnyejese_0-1669231283764.png

 

Accepted Solution (1)
RomanG
Shopify Partner
33 9 12

This is an accepted solution.

Because the add to cart button is wrapped in a product-form__buttons element and it has max-width property now(screenshot1). 
To fixe your issue, please add max-width:44rem into your new button(screenshot2)

screenshot1: 

RomanG_0-1669231898195.png


screenshot2: 

RomanG_1-1669232070743.png

 

If you find my reply helpful, please hit Like and Mark as Solution

Github
Stack Overflow

View solution in original post

Replies 4 (4)

RomanG
Shopify Partner
33 9 12

Hi @NoahOnyejese 

Can you let me know your store url?


If you find my reply helpful, please hit Like and Mark as Solution

Github
Stack Overflow
NoahOnyejese
Excursionist
29 0 6

www.jaglion.co.uk 
Password: JAGLION123

RomanG
Shopify Partner
33 9 12

This is an accepted solution.

Because the add to cart button is wrapped in a product-form__buttons element and it has max-width property now(screenshot1). 
To fixe your issue, please add max-width:44rem into your new button(screenshot2)

screenshot1: 

RomanG_0-1669231898195.png


screenshot2: 

RomanG_1-1669232070743.png

 

If you find my reply helpful, please hit Like and Mark as Solution

Github
Stack Overflow
NoahOnyejese
Excursionist
29 0 6

Thanks a lot it worked!