Center product page info on mobile only

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!

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

password: hello123*

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 tag


RESULT:

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

Best Regards,
Moeed

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?

@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!

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 tag


RESULT:

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

Best Regards,
Moeed

@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!

Thank you, that’s fabulous!

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.