How to center cart items on mobile for my website?

Topic summary

A user seeks CSS code to center specific cart page elements (\

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

Hi, Could I have some code to centre the “your cart” “continue shopping” and order “special instructions” headers but only on mobile thanks.

website is www.stagtis.com

Hi @Stagtis ,

You can try this code by following these steps:

Step 1: Go to Online Store->Theme->Edit code.

Step 2: Search file theme.liquid

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


Hope my solution works perfectly for you!

Best regards,

Oliver | PageFly

@Stagtis Please follow below steps to display “your cart”, “continue shopping” and order “special instructions” texts in the center of the cart page for mobile view alone. Let me know whether it is helpful for you.

  1. From admin panel, go to “Online Store” → “Themes”.
  2. Click action button from the current theme and select “Edit code”.
  3. Search “component-cart.css” and then paste the below code in the bottom of that file.
    CODE:
@media screen and (max-width:450px){
  cart-items .title-wrapper-with-link {
      flex-direction: column;
      align-items: center;
  }
  .cart__footer .cart__note label[for="Cart-note"] {
    width: 100%;
    justify-content: center;
  }
}

Now the texts will look like below,

Please provide your support by click “Like” and “Accepted” if our solution works for you. Thanks for your support.