Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

168
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda