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

137
Views
Click an image to upload file in ReactJS

I am making a react app where I need to click an image which will serve the purpose of a button to upload a file. I can not figure out how to use an image as an input button.

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

0

Probably the easiest way would be to use a wrapper element and pure css for that. just put an image where the text is now.

.wrapper{
  display:inline-block;
  position:relative
}

.btnimg{
  background:red;
  pointer-events:none;
  width:250px;
  height:90px;
  opacity:1;
  line-height:90px;
  text-align:center;
}

input[type=file]{
  opacity:0;
  position:absolute;
  top:0;
  left:0;
  right:0;
  bottom:0;
}
<div class="wrapper">
<div class="btnimg">btn with image</div>
<input type="file">
</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!