Apply z-index to Shopify Chat icon

Topic summary

A user needed to adjust the z-index of the Shopify Chat icon so it would appear behind other site elements like the cart drawer and mobile menu.

Initial Solution Attempt:

  • Another user suggested adding CSS targeting #shopify-chat with z-index: 2 !important; via the theme’s CSS file
  • This approach didn’t work when applied through the custom CSS tab in theme settings

Working Solution:
The original poster resolved the issue by targeting .needsclick class instead:

.needsclick {
  z-index: 2 !important;
}

This successfully hid the chat icon and other buttons beneath active elements. A corrected selector (#ShopifyChat with capital ‘S’ and ‘C’) was also suggested. The issue is now resolved, with an additional tutorial resource shared for managing z-index across Shopify elements.

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

Hi! I’m trying to hide the Shopify Chat icon under other active elements on the site (like cart drawer or mobile menu). I’ve managed to do this on chrome’s developer mode but can’t find a .style to apply. Pls help. I just need z-index: 2; to be applied to the chat.

Hi! To hide the Shopify Chat icon under other elements, add this CSS to your theme:

  1. Go to Online Store > Themes > Actions > Edit Code.
  2. Open your theme.css or theme.scss.liquid file in the Assets folder.
  3. Add the following code:
#shopify-chat {
    z-index: 2 !important;
}
​

Save the changes and refresh your site This will apply the z-index to the chat icon

Doesn’t work. Applied the code in custom css tab in theme settings.

.needsclick {
  z-index: 2 !important;
}

This worked

My bad I didn’t read your console screenshot
Do this instead

#ShopifyChat {
    z-index: 2 !important;
}

Yeah that’s better! I ended up hiding few more buttons by my code with .needsclick style =D Thank you!

1 Like

You’re welcome

Hey! :waving_hand: I’ve actually covered this exact issue in one of my tutorials — it shows how you can control and manage z-index for Shopify elements (like chat icons, drawers, and popups) directly in Shopify Liquid for a cleaner, faster checkout experience.

You can check out the full step-by-step guide here Want a FAST Checkout? Fix Your Shopify Chat Position NOW

It’ll help you fix the z-index properly so the chat icon stays behind other active elements like the cart drawer or mobile menu. Hope it helps! :rocket: