How to Code the button to be centered on each image in image banner when images are split? Dawn

Topic summary

Issue: Center buttons on each half of a split Image Banner in Shopify’s Dawn theme, rather than centered between both images.

Context and attempts:

  • Store link shared; responders requested access details to inspect.
  • Proposed fixes via CSS:
    • Increase button gap and remove max-width constraints for .banner__buttons.
    • Flexbox approach: set banner content to full width and use .banner__buttons–multiple with display: flex; justify-content: space-around; plus disable flex-grow on children.
  • Another suggestion pointed to using theme customization settings for the Image banner.

Outcome so far:

  • Desktop: OP reports the buttons are now correctly centered per image after applying code.
  • Mobile: Buttons display “weirdly” (earlier also noted two buttons on one image). Mobile formatting remains incorrect.

Latest update and open items:

  • A responder suspects a different code was used than their provided snippet and advised checking with the source of the applied code.
  • No finalized mobile-specific CSS fix provided yet. Clarification on which solution was applied and targeted mobile styles is needed.

Notes:

  • Screenshots (desktop result and mobile issue) are central to understanding the layout behavior.
  • Terms: Dawn = Shopify theme; CSS changes modify banner layout and button alignment.
Summarized with AI on December 12. AI used: gpt-5.

I want each button to be centered on each image not in the middle of both? Any Help?

Hi @stonecold

Can you share with me the store link to check further? Thank you

https://uxrhkg-hb.myshopify.com/

In mobile it looks off aswell. There are 2 buttons on one image.

Hi @stonecold , kindly provide your store URL please and if it is password protected, please share the password as well. Thanks

Hi @stonecold ,

  1. Go to Online Store → Theme → Edit code.
  2. Open your theme.css / based.css file and paste the code in the bottom of the file.
.banner__buttons {
    gap: 45rem !important;
    max-width: none !important; 
}

If my reply is helpful, kindly click like and mark it as an accepted solution.

If you are happy with my help, you can help me buy a COFFEE

Thanks!

Hi @stonecold

I just commented on a similar problem like this last night.

https://community.shopify.com/c/shopify-design/how-do-i-center-buttons-in-an-image-banner-for-desktop-and/td-p/2874527

Try the code to your store.

I try it.

  1. From your Shopify admin dashboard, click on “Online Store” and then “Themes”.
  2. Find the theme that you want to edit and click on “Actions” and then “Edit code”.
  3. 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:
.banner__box.content-container {
    max-width: 100%;
    width: 100%;
}

.banner__content.banner__content--middle-center {
     max-width: 100%;
}

.banner__buttons.banner__buttons--multiple {
    display: flex;
    justify-content: space-around;
    max-width: 100%;
    width: 100%;
}
.banner--content-align-center .banner__buttons--multiple>* {
    flex-grow: unset !important;
}

Your Feedback Matters! Please mark the solution and give likes to posts that helped you. Your appreciation fuels our motivation to assist you better!

Hello,

  1. Go to Online Store >> theme >> Customization >> Image banner.

Screenshot 2024-12-10 165027.png

Thanks!

Great, I got it working now. But on Mobile the button is formatted weirdly, is there a solution to this?

I think you are using another code not what I provide. Please, ask them.