Wrapping cart title and continue shopping button

Topic summary

A user working with a custom Ella theme wants to align the cart page title and “Continue shopping” button on the same horizontal line, as they currently stack vertically.

Initial Attempt:

  • Added custom CSS with display: flex, justify-content: space-between, and align-items: center to .cart-header
  • Modified the cart template HTML to wrap both elements in a <div class="cart-header">
  • This approach failed—both elements disappeared from the page

Proposed Solution:

  • Another user suggested adding custom JavaScript code to theme.liquid (above the </body> tag)
  • The code targets .page-header and .button-continue elements and wraps them in a flex container

Problem with Solution:

  • The JavaScript implementation made the entire cart header clickable as a button
  • The cart title itself became a button, which wasn’t the intended behavior
  • User is now seeking help to separate the two elements while maintaining the horizontal alignment

Status: Unresolved—the layout goal hasn’t been achieved without unintended side effects.

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

Hi I’m using a custom Ella theme and I want to wrap my cart title and “Continue shopping button” in the same line like this.

Right now I have the two elements one below each other as can be seen on the image attached. I tried the following code:

<div class="cart-header">
    <h1 class="page-header text-{{ page_title_alignment }}">
        {{ 'sections.cart.title' | t }}
    </h1>
    {% if continue_button_action == "1" %}
        <a class="button button-2 button-continue" {% if custom_button_link == blank %} role="link" aria-disabled="true"{% else %} href="{{ custom_button_link }}"{% endif %} role="button"> {{ 'general.continue_shopping' | t }}</a>
    {% else %}
        <a class="button button-2 button-continue" role="link" aria-disabled="true" onclick="window.history.back();" role="button" id="cart-previous-page-btn">
            {{ 'general.back_to_previous_page' | t }}
        </a>
    {% endif %}
</div>

and added the custom css to base.css

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

but it didn’t seem to work. The only thing that happened is that both the title and the button did not appear, so I did something wrong. Can someone help?

My preview link is: https://1s7nxf9mp6xl073n-26608304175.shopifypreview.com

Hey @SIVA2020

Follow these Steps:

  1. Go to Online Store

  2. Edit Code

  3. Find theme.liquid file

  4. Add the following code in the bottom of the file above tag


If I managed to help you then, don’t forget to Like it and Mark it as Solution!

Best Regards,
Moeed

I did this but then it made the whole cart header into a button, now the cart title is also a button. Can you separate the two?

Before:

After: