How to Center Everything on Product Page ONLY on Mobile?

Hi everyone. Does anybody know how to center everything on the product page including app widgets? And how to do it only on mobile? I would like the PC product page to still be left-centered. I’m on Dawn 2.5.0 Thanks!

1 Like

Hi @a_hs82 ,

Could you please share your store Url, so that I can help you

thesweatshorts.com

I also wanted to update to the newest Dawn theme but it took away all my colors.

1 Like

Hi @a_hs82

Try this one.

  • From your Shopify admin dashboard, click on “Online Store” and then “Themes”.
  • Find the theme that you want to edit and click on “Actions” and then “Edit code”.
  • In the “Assets” folder, click on “base.css, style.css or theme.css” file, depending on which file your theme uses to store its CSS styles. At the bottom of the file, add the following CSS code:
@media only screen and (max-width: 749px){
div#ProductInfo-template--15533910327528__1640719770dec22b67 {
    text-align: center;
}
.price.price--large.price--show-badge {
    justify-content: center;
}
}

Hi. This did not work. It changed my home page but not the product page.

Is there a code I can add to also center my product page? Thanks

1 Like

Oh, Sorry I got confuse. Try this one for product page.

Same Instruction.

@media only screen and (max-width: 749px){
.product__info-wrapper.grid__item {
    text-align: center;
}
}

And Save.

Looks great! Do you also know how to fix the theme problem? I wanted to update to 11.0 but it takes away my colors and says “To preview your changes, color schemes must be defined in settings_data and settings_schema files.”

Also, the code you gave me centered everything on PC too. I only wanted it to be centered on mobile.


everything is really lopsided too. Not sure about what it looks like on mobile as I don’t have my phone.

Thanks for this code however, it didn’t move my quantity selector. Is there a way to fix this?