# CSS for only some background cards

**URL:** <https://community.glideapps.com/t/css-for-only-some-background-cards/28427>\
**Category:** Ask for Help\
**Created:** [June 27, 2021, 9:15pm UTC](https://community.glideapps.com/t/css-for-only-some-background-cards/28427 "2021-06-27T21:15:19Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 28, 2021, 7:47am UTC](https://community.glideapps.com/t/css-for-only-some-background-cards/28427/21 "2021-06-28T07:47:56Z")

</div>

This is very nice! Thanks for sharing.

---

<div class="post-metadata">

**Author:** ![SantiagoPerez](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/santiagoperez/32/16807_2.png) [@SantiagoPerez](https://community.glideapps.com/u/SantiagoPerez)\
**Post date:** [June 28, 2021, 12:33pm UTC](https://community.glideapps.com/t/css-for-only-some-background-cards/28427/22 "2021-06-28T12:33:13Z")

</div>

That’s terrific, @Manu.n!!!

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [June 28, 2021, 1:23pm UTC](https://community.glideapps.com/t/css-for-only-some-background-cards/28427/23 "2021-06-28T13:23:34Z")

</div>

Nicely done @Manu.n.

Is this CSS basically taking the card image and making it an underlay to the card?

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [June 28, 2021, 1:40pm UTC](https://community.glideapps.com/t/css-for-only-some-background-cards/28427/24 "2021-06-28T13:40:00Z")

</div>

Hello @Robert_Petitto  
yes I use the Data Image, you can put a standart image like this example:

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/c/fc8a4b2b1aa8e306e26ad7030346a1306264ef57.jpeg)

> [@Robert\_Petitto](#):
>
> and making it an underlay to the card?

I’m not 100% sure I understand you 😉  
But the principle is simple:

1. fit the image size to the container
2. move the “Bottom Area” up

You have a copyable demo app

> **[Card Img background](https://card-imagefull.glideapp.io/)**

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 28, 2021, 2:40pm UTC](https://community.glideapps.com/t/css-for-only-some-background-cards/28427/25 "2021-06-28T14:40:25Z")

</div>

Yeah this is true. I believe we had the same thought originally on this topic. This works and is terrific, but it’s not exactly the conditional CSS we were looking for.

Let’s say I want cards that don’t have an image not rendering the image space, while those that have one will render. That’s the one thing I believe is conditional CSS and want to apply.

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [June 28, 2021, 2:55pm UTC](https://community.glideapps.com/t/css-for-only-some-background-cards/28427/26 "2021-06-28T14:55:48Z")

</div>

Hello @ThinhDinh

Sorry for not being able to make your wishes come true 😉

the Card structure does not allow conditional CSS.  
You can only do conditional for “Role” type tags, like an “Aria-checkbox” for example, which has an “aria-checked” attribute. I have already used this method for my CSS “UpDown” [CSS Up/Down for Visibility](https://community.glideapps.com/t/css-up-down-for-visibility/27861)

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [June 28, 2021, 3:06pm UTC](https://community.glideapps.com/t/css-for-only-some-background-cards/28427/27 "2021-06-28T15:06:50Z")

</div>

Don’t worry bro your work have always been terrific! I learn a lot from your samples and applied them to my apps.

Have a nice week.

---

<div class="post-metadata">

**Author:** ![NoCodeAndy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nocodeandy/32/62530_2.png) [@NoCodeAndy](https://community.glideapps.com/u/NoCodeAndy)\
**Post date:** [January 17, 2024, 4:51pm UTC](https://community.glideapps.com/t/css-for-only-some-background-cards/28427/28 "2024-01-17T16:51:43Z")

</div>



[Previous page](https://community.glideapps.com/t/css-for-only-some-background-cards/28427.md?page=1)
