Jump to content

Center Variant Selections/Add to Cart Button

Recommended Posts

Hello!

I'm trying to center my variant section options/add to card button (circled in red on the photo).

I've tried the following code (below) from another post, but it wants to move the price/afterpay line as well. I do not want those to move.

.ProductItem-details-checkout {
    display: flex !important;
    justify-content: center;
    align-items: center;
}

I've tried playing with it, but don't know how to isolate only the variants and add to cart button. Any help would be appreciated!

Thank you!

Screen Shot 2023-02-23 at 21.54.50 PM.png

Link to comment
  • Replies 5
  • Views 551
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...
On 3/8/2023 at 9:36 AM, Valisco said:

Add to Design > Custom CSS

/* Mobile Product Center */
@media screen and (max-width:767px) {
.ProductItem-details .product-variants {
    margin: 0 auto !important;
}
.product-quantity-input {
    margin: 0 auto;
}
.ProductItem-details .sqs-add-to-cart-button-wrapper {
    margin: 0 auto;
}
}

 

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
13 hours ago, tuanphan said:

Add to Design > Custom CSS

/* Mobile Product Center */
@media screen and (max-width:767px) {
.ProductItem-details .product-variants {
    margin: 0 auto !important;
}
.product-quantity-input {
    margin: 0 auto;
}
.ProductItem-details .sqs-add-to-cart-button-wrapper {
    margin: 0 auto;
}
}

 

That worked beautifully! Thank you!! Last question,

I decided I liked this layout on desktop as well. When I use the same code, the quantity input box doesn't move to center like the rest. Is there a solution for this?

Thank you!

Screen Shot 2023-03-11 at 17.53.24 PM.png

Link to comment
12 hours ago, Valisco said:

That worked beautifully! Thank you!! Last question,

I decided I liked this layout on desktop as well. When I use the same code, the quantity input box doesn't move to center like the rest. Is there a solution for this?

Thank you!

Screen Shot 2023-03-11 at 17.53.24 PM.png

Add text-align: center; to this code

.product-quantity-input {
    margin: 0 auto;
    text-align: center !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.