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

200
Vistas
Ensure Image Overlay Remains Responsive

I currently have a hero video banner component I am building out. The hero video banner has been given a height of 100vh. On top of the hero video banner, I am placing an image overlay. I am noticing that on screen sizes with less height, the image overlay seems to get cut off. See the attached screenshot to see what I am referring to.

enter image description here

As you can see the lower half of the image overlay gets completely cut off. I am wondering if there is a way to ensure the image overlay no longer gets cut off on these screen sizes with less height I suspect the use of 100vh might be the issue here. Below is the code being used:

video component:

const VideoBanner = (props: IVideoBAannerProps) => {
  return (
    <div className={css.videoContainer}>
      <video playsInline autoPlay muted loop>
        <source src={props?.video} type='video/mp4' />
      </video>
      <div className={css.overlay}>
        <img className={css.img} src={props?.overlayImg} />
      </div>
    </div>
  )
}

export default VideoBanner

Video Banner Styles:

.videoContainer {
  video {
    position: relative;
    width: 100%;
    object-fit: cover;
    height: calc(100vh - 134.5px);
    display: block;
  }

  .overlay {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-color: rgba(39, 39, 39, 0.5);
  }

  .img {
    position: absolute;
    top: 35%;
    left: 4%;
  }
}

@media screen and (max-width: 1199px) {
  .videoContainer {
    .img {
      position: absolute;
      top: 45%;
      left: 4%;
    }
  }
}

@media screen and (max-width: 1199px) {
  .videoContainer {
    video {
      height: calc(100vh - 125px);
    }
  }
}

@media screen and (max-width: 767px) {
  .videoContainer {
    .img {
      position: absolute;
      top: 80%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 70%;
    }
  }
}

about 4 years ago · Juan Pablo Isaza
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