How to center align everything on main product page on mobile

Topic summary

A user seeks to center-align all elements on their mobile product page, including product description, title, buttons, and an in-stock pulse indicator.

Solutions Provided:

Two community members offered CSS code snippets to be added to the theme’s stylesheet (base.css, theme.css, or similar):

  • BSSCommerce-B2B provided code targeting product-info elements with text-align: center, margin: auto, and display: block adjustments for the pulse icon
  • Made4uo-Ribe offered similar CSS targeting .product__info-container, product titles, buttons, and the in-stock pulse with flexbox centering (display: flex; justify-content: center)

Current Issue:

The user reports partial success—most elements are centered, but the green pulse icon itself hasn’t moved to center. Instead, only the gap between the icon and its text increased. They want the entire pulse element centered with consistent spacing.

Summarized with AI on November 8. AI used: claude-sonnet-4-5-20250929.

How can i center align everything that is visible in this image. Like the description part i did it while writing description in product section.

Store: theavalonz.in

1 Like

how?

Hi @LokNdra
Step 1: Go to Shopify Admin → Online Store ->Theme → Edit code

Step 2: Search file base.css, theme.css, styles.css, custom.css or theme.scss.liquid

Step 3: Insert the below code at the bottom of the file → Save

product-info .instock-pulse {
    display: block !important;
}
product-info span.icon--pulsing {
    margin-right: 20px !important;
}
product-info .product-form__input,
product-info .product-form__buttons {
    margin: auto;
}
product-info .product-popup-modal__opener {
    width: 100%;
}
product-info * {
    text-align: center;
}

Here is result:

Hope this can help you,

If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you

Hi @LokNdra

Check 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:

.product__info-container>*+* {
    text-align: center;
}
.product__title {
    text-align: center;
}
.instock-pulse {
    justify-content: center;
}
modal-opener.product-popup-modal__opener.quick-add-hidden {
    display: flex;
    justify-content: center;
}
.product-form__buttons, .product-form__input--pill {
    margin: auto;
}

And Save.

Result:

Hey only that green impulse icon is not shifted in center instead the gap between green light and it’s text is increased little bit. I want same gap and whole in center.