How do I Center Featured Product and Product Page Contents on Mobile in Craft Theme?

Hi there, I am needing to center both the featured product and all content for the product page in Shopify’s “Craft” theme.

Rule out SEARCH first https://community.shopify.com/search?q=center+feature+craft+theme

@btrflybld hello, do you mean like this?

Yes, exactly like that!

Hi @btrflybld

  1. In your Shopify Admin go to online store > themes > actions > edit code
  2. Find Asset > base.css and paste this at the bottow of the file:
@media screen and (max-width: 767px) {
  .product__info-container {
    text-align: center;
    margin: 0 auto;
  }

  .product-form__input .price-per-item,
  .price-per-item__container {
    justify-content: center;
  }
}

Best regards,
Devcoder :laptop:

Hi @btrflybld ,
Go to Online Store > Themes > Actions > Edit Code > base.css Add below code at the bottom of base.css file

@media (max-width: 768px) {
    .product__info-wrapper.grid__item {
        text-align: center;
    }
    .price-per-item__container {
        justify-content: center;
    }
}

This worked perfectly thank you so much!

Hi @btrflybld

Thank you for your response. It’s good to know that it’s worked for you. Kindly feel free to get back to me if you need any further assistance. If helpful, please like all posts. :white_check_mark:

Best regards,
Devcoder :laptop:

@devcoders Can you assist me with making the “Add to Cart” button a smaller width on mobile, similar to how the featured collection “Shop More” button appears?

Hi @btrflybld

  1. In your Shopify Admin go to online store > themes > actions > edit code
  2. Find Asset > base.css and paste this at the bottow of the file:
@media (max-width: 749px) {
  .product-form__buttons {
    max-width: 16rem;
    margin: 0 auto;
  }
}

Unfortunately this did not work

Hi @btrflybld

  1. In your Shopify Admin go to online store > themes > actions > edit code
  2. Find Asset > base.css and paste this at the bottow of the file:
@media (max-width: 749px) {
  .product-form__buttons {
    max-width: 16rem!important;
    margin: 0 auto;
  }
}

@devcoders Thanks so much! That one worked.

Hi @btrflybld

Thank you for getting back to me. I’m happy to hear that it worked for you. Should you need any further help, please don’t hesitate to reach out. If you found the post helpful, kindly consider giving it a like.

Best regards,
Devcoder :laptop: