Make button full width

Hi, I would like this button on the product page to be at the same width as the line above the description , but the text should stay center aligned. thank you for your help!

Pass: daumas

I tried this but it didn’t work
@media (min-width: 1024px) {
.btn–primary {
display: block;
width: 100%;
}
}

1 Like

Hi @Daniel19901

You can try to use this code instead

@media (min-width: 1024px) {
.product .btn--primary {
max-width: 100% !important;
}
}

@Dan-From-Ryviu thx but it didn’t work

Please update the code

@media (min-width: 990px) {
.product-page .shopify-product-form {
max-width: 100% !important;
}
}

Hi @Daniel19901

Try this one.

  1. From your Shopify admin dashboard, click on “Online Store” and then “Themes”.
  2. Find the theme that you want to edit and click on “Actions” and then “Edit code”.
  3. In the “Assets” folder, click on “base.css, style.css or theme.css” file, depending on which file your theme uses to store its CSS styles. At the bottom of the file, add the following CSS code:
@media only screen and (min-width: 1024px){
.product__inner .shopify-product-form {
    max-width: 100% !important;
}
}

Your Feedback Matters! Please mark the solution and give likes to posts that helped you. Your appreciation fuels our motivation to assist you better!

1 Like