Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

245
Views
Image next/js and tailwind opacity effect

I want to change the html tag to nex/js Image, but the opacity effect on hover doesn't work anymore.

Initial code:

 <div
          className="absolute bg-cover bg-no-repeat h-full w-full group-hover:opacity-0"
          style={{
            height: mediaHeight,
            backgroundImage: `linear-gradient(rgba(15, 41, 55, 0.65), rgba(15, 41, 55, 0.65))`,
          }}
        />
        <img
          src={getAbsUrl(imageUrl)}
          alt={title}
          className="w-full object-cover"
          style={{ height: mediaHeight }}
        />

With next/js

<div
          className="absolute bg-cover bg-no-repeat h-full w-full group-hover:opacity-0"
          style={{
            height: mediaHeight,
            backgroundImage: `linear-gradient(rgba(15, 41, 55, 0.65), rgba(15, 41, 55, 0.65))`,
          }}
        />
        <Image
          src={getAbsUrl(imageUrl)}
          alt={title}
          className="w-full object-cover bg-opacity-25"
          layout="fill"
        />

With Image the pictures are always lighted not just only on hover

enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

SOLVED: I've used zIndex from tailwind on the div

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!