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

160
Views
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 answers
Answer question

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 Report

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 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!