# Container Backgrounds CSS

**URL:** <https://community.glideapps.com/t/container-backgrounds-css/86984>\
**Category:** Ask for Help\
**Tags:** custom-css\
**Created:** [April 29, 2026, 10:03pm UTC](https://community.glideapps.com/t/container-backgrounds-css/86984 "2026-04-29T22:03:23Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [May 4, 2026, 3:20am UTC](https://community.glideapps.com/t/container-backgrounds-css/86984/11 "2026-05-04T03:20:52Z")

</div>

Are you applying a custom class per specific collection component? It would help to see the settings in your Glide dashboard where the class is assigned, and please also share a screenshot of your custom CSS.

Avoid using broad selectors like `.collection-item > div` or `.collection-item-dark > div` unless you are certain of the exact target element, as this can unintentionally affect multiple nested elements.

If your intention is to have one collection use the default style and another use a custom style, then proper scoping is required. For example:  
`.custom-class [data-testid="cc-card"] { ... }`  
should work as long as `.custom-class` is correctly assigned in the Glide component options tab.

If you are trying to achieve dynamic or conditional styling behavior per collection instance, you may also find this approach relevant:

> [@link CSS Hack: Dynamic CSS in Glide 2 via URL Fragment](https://community.glideapps.com/t/css-hack-dynamic-css-in-glide-2-via-url-fragment/85613):
>
> Use image URL fragments as lightweight, reliable selectors. I previously shared [brain CSS Hack: Dynamic CSS in Glide](https://community.glideapps.com/t/css-hack-dynamic-css-in-glide/85080#:~:text=CSS%20Hack%3A%20Dynamic%20CSS%20in%20Glide) — a method relying on Rich Text injection — and also using attributes already available in Glide: [https://community.glideapps.com/t/css-hack-dynamic-css-in-glide/85080/4](https://community.glideapps.com/t/css-hack-dynamic-css-in-glide/85080/4). However, many of Glide’s built-in attributes are not stable as selectors because they may be translated. A more reliable method is to append a fragment at the end of the image URL. Example Note: The followi…

> If you want to avoid layout shift (e.g. border affecting image size), you can use `outline` instead of `border`, since outline does not affect element dimensions.

---

_[View the full topic](https://community.glideapps.com/t/container-backgrounds-css/86984)._
