Solved

How to center cart items on mobile for my website?

Stagtis
Explorer
65 0 13

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

 

Screenshot 2024-02-16 104924.png

Screenshot 2024-02-16 104707.png

Accepted Solutions (2)

PageFly-Oliver
Astronaut
878 190 171

This is an accepted solution.

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

 

<style>
@media(max-width:767px){
cart-items .title-wrapper-with-link{
justify-content: center !important;
}}
</style>

 

 

Hope my solution works perfectly for you!

Best regards,

Oliver | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


PageFly - #1 Page Builder for Shopify merchants.


All features are available from Free plan. Live Chat Support is available 24/7.

View solution in original post

Vinsinfo
Shopify Partner
247 90 82

This is an accepted solution.

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

priyavinsinfo_0-1708583014724.png

 

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

View solution in original post

Replies 2 (2)

PageFly-Oliver
Astronaut
878 190 171

This is an accepted solution.

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

 

<style>
@media(max-width:767px){
cart-items .title-wrapper-with-link{
justify-content: center !important;
}}
</style>

 

 

Hope my solution works perfectly for you!

Best regards,

Oliver | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


PageFly - #1 Page Builder for Shopify merchants.


All features are available from Free plan. Live Chat Support is available 24/7.

Vinsinfo
Shopify Partner
247 90 82

This is an accepted solution.

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

priyavinsinfo_0-1708583014724.png

 

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