How can I reposition the cart and resize the header on my ecommerce site?

Topic summary

Goal: move the cart icon under the logo (centered) and reduce the header’s vertical space.

  • Context: Shopify store sadsociety.fr (password: test). Initial change requested only on mobile; later applied to both mobile and desktop.
  • Iteration: Helper prototyped locally and shared screenshots. OP requested precise alignment (logo and stars centered; star slightly higher). Adjustments were made accordingly.
  • Implementation: Helper provided CSS to paste into theme.liquid (above ) via Online Store > Themes > Edit code > theme.liquid. OP confirmed the cart repositioning works. OP had found cart markup in header.liquid; helper clarified CSS placement remains in theme.liquid.
  • Further change: OP clarified “header border” means reducing spacing between header and body on both desktop and mobile (less reduction on mobile). Helper supplied a merged CSS replacement that keeps the cart under the logo and reduces header spacing, instructing OP to replace the previous code.

Status: Cart repositioning solved and live. Header spacing reduction provided via new CSS; awaiting OP’s final confirmation. Screenshots were central to alignment decisions.

Summarized with AI on January 17. AI used: gpt-5.

Hello,

Any developer would tell me how to change the position of the cart to put it, for example under the logo in the middle and not on the right of the page?

And reduce the size of the header, I have a 250x250 logo but the borders of the header are too big it takes a lot of space.

Thank you

Hi @kristibajr ,

Can you provide your store’s URL? I will look into the store and let you know the solution if its quick.

Thank you

sadsociety.fr password: test

Hi,

Do you mean adding this icon here?

Yes

It will take a few time. I will look into it and get a solution.

just on mobile phone

Hi @kristibajr ,

Does this look good to you? Is this something you are looking for?

Logo and stars must be aligned in the middle.

And the star a little higher.

Can you explain to me how you did this and how I can change it in the future?

hi @kristibajr ,

This change is only on my machine. I am working on it locally.

By “And the star a little higher.” do you mean i should increase the space between logo and the star?

not just decrease a little bit

like this it will be perfect

Hi @kristibajr ,

Is it ok now? If yes i will provide you with the code that should be added.

Hi @kristibajr ,

I have written few CSS that will move the cart icon below logo. I have also positioned the cart icon on the mentioned position. Please add below codes to the theme.liquid file.


Steps to add CSS:

Step 1: Go to Online Store > Themes > Active theme > Edit

Step 2: Search for “theme.liquid”

mangitma_1-1695573744233.png

Step 3: Add the CSS above “”

mangitma_2-1695573744226.png

If you require further help to optimize your store or stuck while adding code to the theme, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!

Best Regards,
Mangit

yes perfect

I found the code for the cart in header.liquid :

{% include 'icon-cart' %} {{ 'layout.cart.title' | t }}
{{ cart.item_count }} {{ 'layout.cart.items_count' | t: count: cart.item_count }}

but I don’t know where is the css file to modify the placement and resize the header.

You can just add the Code that i provided on the theme.liquid file following below steps.

Steps to add CSS:

Step 1: Go to Online Store > Themes > Active theme > Edit

Step 2: Search for “theme.liquid”

mangitma_1-1695574193396.png

Step 3: Add the CSS above “”

mangitma_2-1695574193319.png

Step 4: Save the change

If you are still confused, please let me know.

It works ! thank you so much

now how can I reduce the size of the header border ?

Do you mean reducing the size of logo? I am unaware about what header border you are refering to

Reduce a little bit this spacing between the header and the body