Using Images as Backgrounds

Hello everyone,

I’ve created a field for an image. I was wondering if it’s possible to use these images as backgrounds for the cards.

Specifically, I’d like the background image to change when I see the back of the card. Has anyone tried this before or does anyone know if this is possible?

Any help would be greatly appreciated!

It is possible. Here is an example:

Fields

  • Front
  • Back
  • Background Image

Back Template

<div id="image-layer">{{Background Image}}</div>

{{FrontSide}}

<hr id=answer>

{{Back}}

Styling

#image-layer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
}

#image-layer img {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    object-fit: cover;
}

Screenshot

4 Likes

Thank you

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.