Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

240
Vistas
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 Respuestas
Responde la pregunta

0

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

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda