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
object-fit:cover resizes img width

I'm trying to make a carousel slide, but when I'm using object-fit:cover and adding the second image the first and the second image width are changing from 100% to 50%

on 1 input it works fine See photo here

on second input it's changing its width See photo2 here

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

0

I think the object-fit:cover property can be set with the width property.

image {
    width: 100%;
    object-fit: cover;
}

Then the image places appropriately so that it's width is 100%.

about 4 years ago · Juan Pablo Isaza Report

0

If you really want img to be 100% in flex layout you can use one of these options:

img {
    width: 100%;
    flex-shrink: 0;
}

img {
    min-width: 100%;
}

If smth else - update/improve your question

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!