Center variant pills in product page

Leonpojen
Explorer
62 0 5

Hello, I'm trying to align the variant pills in the center like the add to cart button bellow.

 

Appreciate if anyone shared the code!

 

Site url: https://23bc4a.myshopify.com/

 

/Leon

 

 

 

Screenshot 2023-03-20 at 17.17.21.png

Replies 6 (6)
kgbfashionista
Trailblazer
221 14 21

Add this code to your theme.css file:

 

.product-form__input{

align: center;

}

Leonpojen
Explorer
62 0 5

There is no file named theme.css, are you referring to theme.liquid?

kgbfashionista
Trailblazer
221 14 21

No, there should be a general css file. I might be as well called theme.scss

Leonpojen
Explorer
62 0 5

Not for me?

Screenshot 2023-03-20 at 17.39.38.png

PageFly-Victor
Shopify Partner
7865 1782 2951

Hi @Leonpojen ,

This is Victor from PageFly - Landing page builder, I’d like to suggest this idea:

Step 1. Go to Online Store -> Theme -> Edit code
Step 2. Open your theme.liquid theme file
Step 3. Paste below code before </body> :

<style>
@media (max-width:767px){
variant-radios#variant-radios-template--17819497562379__main {
    text-align: center;
    justify-content: center;
    display: flex;
}
}
</style>

Hope my answer will help you.

Best regards,

Victor | PageFly

ZestardTech
Shopify Expert
4343 749 1022

Hello There,
1. In your Shopify Admin go to online store > themes > actions > edit code
2. Find Asset -> base.css and paste this at the bottom of the file:

@media screen and (max-width: 767px){
	.product-form__input {
	    text-align: center;
	    margin: 0 auto;
	}
	.product__title {
	    text-align: center;
	}
	.product-form__buttons {
	    margin: 0 auto;
	}
}

ZestardTech_0-1683613804036.png

 

Want to modify or develop new app, Hire us.
If helpful then please Like and Accept Solution .
Email: support@zestard.com
Shopify Apps URL :- https://apps.shopify.com/partners/zestard-technologies
Custom Modifications Into Shopify Theme | Shopify Private App | SEO & Digital Marketing