How to change the background colour of my drop down menus and add an image to each item

Topic summary

A Shopify store owner wants to modify dropdown menus by changing their background color (currently blending with the page) and adding product images next to each menu item.

Solutions Provided:

  • Background color change: Multiple users suggested adding CSS code to base.css targeting .header .js details > .header__submenu with a custom hex color value
  • Adding product images: Van_Nguyen_GSG provided code to insert in the theme files where child links are rendered, checking if the link type is ‘product_link’ and displaying the featured product image

Implementation Details:

  • Code placement varies by theme but typically involves editing header.liquid in the sections folder
  • The Dawn theme was used as a demonstration example
  • Initial confusion arose around locating “childlink” in the code, resolved through clarification about theme-specific variations

Current Status:

The original poster confirmed the desktop version works perfectly. However, a mobile layout issue was mentioned but appears resolved based on the final thank-you message. Two other users later requested similar assistance for their own stores.

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

Hello!

I just want to change the background colour of my two drop down menus “Shop” and “Sustainable product shout outs” (currently the colour is the same as the page and it blends in too much.

I also want to see if I can add an image of each product in the drop down menu like the example below.

Website is www.houseoftierney.com.au

Any advice would be much appreciated!

Hi @ktierney , This is Richard from PageFly - Landing page builder.

You can try this code by following these steps:

Go to Online store => themes => actions => edit code and add this code on file theme.liquid before tag


I hope it would help you Best regards,

Richard | PageFly

1 Like

Hi Ktierney,

  1. To change background color of any menu items which have sub menu (dropdown) > paste this code at the end of base.css :

.header .js details > .header__submenu {

background-color: #ffffff;

}

You can change the color hex code to color you want

  1. Adding product image to the submenu items:

Find where the childlink stay in the code and place this piece of code under the childlink.title:

{% if childlink.type == “product_link” %}
{{ childlink.object.featured_image | image_url: width: 150 | image_tag:
class: ‘link-image’,
alt: childlink.object.featured_image.alt,
preload: true
}}
{% endif %}

The screenshot of my demo store using Dawn theme:

If you still need help, feel free to contact me.

1 Like

Hi @ktierney

  1. Go to the online store

  2. Edit the code base.css file below paste the code

ul#HeaderMenu-MenuList-6 {
background: #fff;

}

Hello! That demo is exactly what I want with the pictures next to the item.

Sorry I don’t really understand your instructions though.

When you say “Find where the childlink stay in the code” what does this mean? I tried Ctrl “childlink” in the code but nothing came up.

Hi,

Your theme might be different. But the logic is the same. Go to sections > header.liquid > find where in the code that render the dropdown child-link (the name can be different to your theme) and apply my code above.

If you still need help, feel free to contact me.

1 Like

Hello,

this worked to change the desktop screen website but it’s still the same on the mobile layout. How would I fix this?

I still need help lol

Will email you

Thank you so much for your help! It’s perfect now!

1 Like

Hello Kat! I am trying to apply this to my website but haven’t been able, do you think you can help me please?

Hello I am still struggling to get this code to change the background color of the drop down menu, please can you assist me?