Jump to content

How to Center 'add to cart' button in product description

Recommended Posts

Site URL: https://www.intro-verso.com/all-new-products

Hello,

 

I'd like to move my Add To Cart button (which I changed the text of to 'contact to purchase') to the center of the text block.

At the moment it is alligned left, just like the text which looks messy espacially on mobile view. However I don't see an option to manually do this, is there a code to make this change?

 

Any help is much appreciated!

Screen Shot 2021-11-09 at 12.05.07.png

Screen Shot 2021-11-09 at 12.05.31.png

Link to comment
  • Replies 8
  • Views 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

4 hours ago, Mathias654321 said:

Site URL: https://www.intro-verso.com/all-new-products

Hello,

 

I'd like to move my Add To Cart button (which I changed the text of to 'contact to purchase') to the center of the text block.

At the moment it is alligned left, just like the text which looks messy espacially on mobile view. However I don't see an option to manually do this, is there a code to make this change?

 

Any help is much appreciated!

Screen Shot 2021-11-09 at 12.05.07.png

Screen Shot 2021-11-09 at 12.05.31.png

You can try adding to Home > Design > Custom Css

.sqs-add-to-cart-button-wrapper {
  text-align:center;
}

Let me know how it works on your site

Press 👍 or mark this answer as solution to help another one too

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

My testing result

image.thumb.png.9410b1eef90654cdda08e756474fdb5b.png

On desktop

image.png.26653c15303d22809df303d7f40da210.png

On Mobile

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
On 11/10/2021 at 4:30 PM, Mathias654321 said:

This works well, thank you very much!

Is there a way to only implement this on mobile view, and keep the button alligned left for desktop view?

That would be my ideal setup.

 

Appreciate your time

Try wrap the code in media query.

First, remove above code & use this code

@media screen and (max-width:640px) {
.sqs-add-to-cart-button-wrapper {
  text-align:center;
}
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 4 months later...
  • 1 year later...
13 hours ago, lynnesome said:

Hey I tried this for my 7.1 site but it didn't work, is that different?

Relatedly, on mobile, the text for my "Materials" dropdown is overlaying the dropdown caret, I'd love some ideas on that too (see screenshot). Thank you! 

image.png.64f08f714fbe7945a97bd0654e03d1ba.png

Site is https://piccolo-prism-pb2h.squarespace.com/ password is boysdrool 

Use this CSS code for both problems

/* mobile product */
@media screen and (max-width:767px) {
.ProductItem-details .product-variants {
    width: 90% !important;
}
#page .ProductItem-details-checkout .sqs-add-to-cart-button-wrapper {
    margin: 0 auto !important;
}
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.