Megamenu Issues ( Shopify Dawn Theme )

Topic summary

A user customized a megamenu with images in Shopify’s Dawn theme but encountered layout issues requiring CSS adjustments.

Initial Problems:

  • Images not displaying in a single horizontal line on desktop
  • Text labels wrapping to two lines instead of one
  • Excessive spacing between images and text labels

Solution Process:
Another user provided iterative CSS fixes targeting the megamenu’s flexbox layout:

  • Applied flex-wrap: nowrap to force single-line image display on desktop
  • Set fixed flex-basis (140px) to create consistent spacing between images
  • Adjusted margin-top to reduce gap between images and text
  • Added font styling (1.17rem, bold) for desktop text labels

Current Status:
The desktop layout appears resolved. A remaining issue exists in mobile view where spacing between images and text is reportedly too large, though the most recent CSS update addressed text styling and may have partially resolved this concern. The discussion shows ongoing refinement through code snippets and screenshot comparisons.

Summarized with AI on October 27. AI used: claude-sonnet-4-5-20250929.

Hello Everyone!

I am using Shopify Dawn Theme. I have added images to the mega menu through coding.

  1. I want to keep the images in one line in desktop mode. It is fine in mobile mode.
  2. I want to keep the text below the image in one line. It is showing 2 lines.
  3. I want to reduce the space between the image and the text a little in desktop and mobile mode.
    I have added the image below.

Store: https://dream-candle-lights.myshopify.com/

Password: Admin

I want to keep it exactly like this image.

Hi @dreamtechzone_5

let try to add this custom css code:

@media (min-width: 768px) {
  #Details-HeaderMenu-6 .mega-menu__list {
    flex-wrap: nowrap;
  }
  #Details-HeaderMenu-6 .mega-menu__list > li {
    flex: 0 0 max-content;
  }
}
#Details-HeaderMenu-6 .mega_menu_img .title {
  height: auto;
  margin-top: 10px;
  width: auto;
  border-radius: unset;
}

the result will look like:

1 Like

Great it worked. But I want to increase the space between images. The images stick to each other. And I want to keep the same space between each image. Thank you very much.

let replace with this css:

@media (min-width: 768px) {
  #Details-HeaderMenu-6 .mega-menu__list {
    flex-wrap: nowrap;
  }
  #Details-HeaderMenu-6 .mega-menu__list > li {
    flex: 0 0 140px;
  }
}
#Details-HeaderMenu-6 .mega_menu_img .title {
  height: auto;
  margin-top: 10px;
  width: auto;
  border-radius: unset;
}

The space in the image doesn’t seem to be the same.

to make space same, you have to use as this https://community.shopify.com/c/shopify-design/megamenu-issues-shopify-dawn-theme/m-p/3057920/highlight/true#M798257

1 Like

Can the text be small and bold in desktop mode?
And in mobile mode, there seems to be more space between the image and the text.

ok let replace with this css:

@media (min-width: 768px) {
  #Details-HeaderMenu-6 .mega-menu__list {
    flex-wrap: nowrap;
  }
  #Details-HeaderMenu-6 .mega-menu__list > li {
    flex: 0 0 140px;
  }
}
#Details-HeaderMenu-6 .mega_menu_img .title {
  height: auto;
  margin-top: 30px;
  width: auto;
  border-radius: unset;
  font-size: 1.17rem;
  font-weight: bold;
}

1 Like