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

205
Views
Blurred box with transparent center with css in react js

I have a design like this:

enter image description here

and I have a code like this:

<div data-testid="container" class="reactEasyCrop_Container img-crop-container">
     <img alt="" class="reactEasyCrop_Image reactEasyCrop_Contain img-crop-media" src="" 
     />
     <div data-testid="cropper" class="reactEasyCrop_CropArea 
     reactEasyCrop_CropAreaRound" style="width: 371.594px; height: 371.594px;">
     </div>
</div>

Now, how can I have this blur box that is transparent in the center with this code and CSS? Note that I can only use CSS and can't change the HTML code

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Without changing the html structure you can use radial-gradientto do so

.reactEasyCrop_CropAreaRound {
  display: none;
}

.img-crop-container {
  position: relative;
  width: 200px;
}

.img-crop-container::after {
  content: "";
  width: 100%;
  height: 100%;
  background: #FFFFFF70;
  position: absolute;
  background: radial-gradient(circle at center, transparent 50%, #ffffffa0 50%);
filter: drop-shadow(0px 0px 6px #ffffffa0);
  top: 0;
  left: 0;
}
<div data-testid="container" class="reactEasyCrop_Container img-crop-container">
  <img alt="" class="reactEasyCrop_Image reactEasyCrop_Contain img-crop-media" src="https://picsum.photos/200" />
  <div data-testid="cropper" class="reactEasyCrop_CropArea 
     reactEasyCrop_CropAreaRound" style="width: 371.594px; height: 371.594px;">
  </div>
</div>

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!