To continue receiving payouts, you need to secure your account by turning on two-step authentication. If two-step authentication is not turned on your payouts will be paused. Learn more

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

Solved
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)

Accepted Solutions
RomanG
Shopify Partner
22 6 3

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
22 6 3

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
RomanG
Shopify Partner
22 6 3

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