Center product page info on mobile only

Solved

Center product page info on mobile only

kirsten11123
Shopify Partner
49 0 18

Hello!

 

My theme automatically center aligns certain product info on the MOBILE product page, however it doesn't do all of the info I want. Can someone please help me with coding the intro offer section and the inventory tracker to be centered too? The description and everything below the line can stay left aligned.

 

Thank you!

 

Screenshot 2024-07-02 at 9.34.04 PM.png 

site: https://healing-purpose.myshopify.com/products/organic-wild-blueberry-powder

password: hello123*

Accepted Solution (1)
Moeed
Shopify Partner
6530 1773 2144

This is an accepted solution.

Apologies for the confusion, just simply add this code then.

Follow these Steps:

1) Go to Online Store
2) Edit Code
3) Find theme.liquid file

4) Add the following code in the bottom of the file above </body> tag

<style>
@media screen and (max-width: 767px) {
.feature-badge {
    width: 100% !important;
    place-content: center !important;
}
variant-inventory.inventory.text-warning {
    place-content: center !important;
}
}
</style>

RESULT:

Moeed_0-1719928201940.png

 

If I managed to help you then, don't forget to Like it and Mark it as Solution!

 

Best Regards,
Moeed

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Custom Design | Advanced Coding | Store Modifications


View solution in original post

Replies 7 (7)

Moeed
Shopify Partner
6530 1773 2144

Hey @kirsten11123 

 

Follow these Steps:

1) Go to Online Store
2) Edit Code
3) Find theme.liquid file

4) Add the following code in the bottom of the file above </body> tag

<style>
@media screen and (max-width: 767px) {
.product-info__block-list {
    text-align-last: center !important;
    text-align: center !important;
}
.variant-picker.v-stack.gap-4 {
    justify-items: center !important;
}
.variant-picker__option-info.h-stack.justify-between.gap-2 {
    justify-self: center !important;
}
}
</style>

RESULT:

Moeed_0-1719927644405.png

 

If I managed to help you then, don't forget to Like it and Mark it as Solution!

 

Best Regards,
Moeed

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Custom Design | Advanced Coding | Store Modifications


kirsten11123
Shopify Partner
49 0 18

Hi! Thank you, that did work, however I'm hoping to only target the text with green background and the inventory notice. Is there any way to just target those elements?

Moeed
Shopify Partner
6530 1773 2144

This is an accepted solution.

Apologies for the confusion, just simply add this code then.

Follow these Steps:

1) Go to Online Store
2) Edit Code
3) Find theme.liquid file

4) Add the following code in the bottom of the file above </body> tag

<style>
@media screen and (max-width: 767px) {
.feature-badge {
    width: 100% !important;
    place-content: center !important;
}
variant-inventory.inventory.text-warning {
    place-content: center !important;
}
}
</style>

RESULT:

Moeed_0-1719928201940.png

 

If I managed to help you then, don't forget to Like it and Mark it as Solution!

 

Best Regards,
Moeed

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Custom Design | Advanced Coding | Store Modifications


kirsten11123
Shopify Partner
49 0 18

Thank you, that's fabulous!

Moeed
Shopify Partner
6530 1773 2144

Thank you for your reply. I'm glad to hear that the solution worked well for you. If you require any more help, please don't hesitate to reach out. If you find this information useful, a Like would be greatly appreciated.

- Need a Shopify Specialist? Chat on WhatsApp

- Get a quick Shopify quote – Click here!

- Custom Design | Advanced Coding | Store Modifications


vm-web
Shopify Partner
29 1 4

@kirsten11123 

Hi! Thank you, that did work, however I'm hoping to only target the text with green background and the inventory notice. Is there any way to just target those elements?

Solution

Please add the following CSS code to your assets/theme.css bottom of the file.

@media screen and (max-width: 767px) {
.feature-badge {
    display: flex !important;
    margin: 0 auto !important;
    justify-content: center !important;
}
}

Thanks!

 

If helpful then please Like and Accept Solution.

vm-web
Shopify Partner
29 1 4

@kirsten11123 

Please add the following CSS code to your assets/theme.css bottom of the file.

@media screen and (max-width: 767px) {
.product-info__block-list {
    text-align-last: center !important;
    text-align: center !important;
}
.variant-picker.v-stack.gap-4 {
    justify-items: center !important;
}
.variant-picker__option-info.h-stack.justify-between.gap-2 {
    justify-self: center !important;
}
}

Thanks!

If helpful then please Like and Accept Solution.