0

I have been working on this issue for like 4 hours now and I am coming up with nothing.

I want to be able to make a card element for my website, I want the background to be blurred but i want an image on top of that blurred image and text.

I am using tailwind and so far my attempts have blurred everything.

Here is my attempt https://play.tailwindcss.com/PK2FXaIYx4?size=564x720

j08691
  • 204,283
  • 31
  • 260
  • 272
Nathan E
  • 33
  • 5

1 Answers1

1

You will need to play around with position: relative and absolute. Also need filter: blue(px) on style attribute.

See a working example https://play.tailwindcss.com/qMDnmBi9Lo

<div class="w-80 h-96 relative">
  <div class="absolute inset-0 z-0">
    <img src="https://static.wikia.nocookie.net/jumanji/images/1/1b/Jumanji_2017_Poster.jpg/revision/latest/scale-to-width-down/1000?cb=20181023182751" alt="" srcset="" style="filter: blur(4px)" />
  </div>

  <div class="absolute inset-0 z-10">
    <div class="flex flex-col transform scale-75 space-y-4">
      <img src="https://static.wikia.nocookie.net/jumanji/images/1/1b/Jumanji_2017_Poster.jpg/revision/latest/scale-to-width-down/1000?cb=20181023182751" alt="" srcset="" />
      <div class="text-white text-2xl text-center">Jumanji</div>
    </div>
  </div>
</div>
Digvijay
  • 7,836
  • 3
  • 32
  • 53