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

124
Views
How can I fit a img into a div wholly?

.flexbox-item-1 {
  min-height: 300px;
  min-width: 300px;
  border: 3px solid red;
  overflow: hidden;
  /* background: url("./Zodiac_Logos_jpg/Aries_zodiac_logo.jpg"); */
  /* background-size: cover; /* fits the whole image inside */
}

#Aries_pic_1 {
  /* position: absolute; */
  /* left: 67.5px; */
  max-height: 100%;
  max-width: 100%;
}
<div class="flexbox-container">
  <div class="flexbox-item_one flexbox-item-1">
    <div>
      <a href="Aries_page.html" class="Get_1" target="_blank">
        <img src="./Zodiac_Logos_jpg/Aries_zodiac_logo.jpg" id="Aries_pic_1">
      </a>
    </div>
  </div>
</div>

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

0

Use object-fit: cover; css style. Make sure to set width and height on the image for it to work.

<!-- you can set the height to whatever you like, even make it a flex item. -->
<div style="width: 200px; height: 100px;">
   <style>
     .my-image {
       width: 100%;
       height: 100%;
       object-fit: cover;
     }
    </style>

 <img class="my-image" src="your-image.extension" />

</div>

Then just put the div anyway and size it to whatever you want.

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!