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

163
Vistas
How to make background dim when you press your modal button with react

I have a problem when I press my modal button, it just shows the modal but the background is not dim.

The example that I want is here Example

This is my code  JS
[JS][2]https://pastebin.com/04AG1Y0f

and my CSS 
[CSS][3]https://pastebin.com/04AG1Y0f

How to make it like the image

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

(if you are using bootstrap...)
You just need to add data-backdrop="static" attribute to your modal.

What you are looking for is called modal backdrop.

you can read more about it here.

about 4 years ago · Juan Pablo Isaza Denunciar

0

What you can do is, in addition to rendering a modal when you click your button, also render an empty div. Style the div such that it has a fixed position and covers the entire screen, have a gray color, and set the opacity such that it looks like in your example above. Should also set a low/negative z-value so that it doesn't appear on a layer above your modal.

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