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

188
Views
How force object-cover image on div child with Tailwind?

I'm creating a flat listview for a React website. This is a picture of my mockup: enter image description here

I succed to obtain this: enter image description here

Next, I would like to limit the size of the flat list and display the overflow-x-scroll. The problem is, when I put a size, my first image have a wrong display... enter image description here

This is my code (I use tailwind):

import React from "react";

export type CarrouselProps = {
    images: string[],
    size: number
}
const Carrousel: React.FC <CarrouselProps>  = ({images, size}) => {

    return(
        <div>
            <div className="flex flex-row overflow-x-scroll w-[700px]">
                {images.map(url => 
                    <input className={`w-[${size}px] h-[${size}px] mr-4 object-cover rounded-md`} type="image" src={url} /> 
                )}
            </div>
            <div className="h-1 mt-3 bg-white w-[700px]"/>
        </div>
    );
}

export default Carrousel;

Could you help me to fix this wrong display on the first image ? I specify that only the first image have portrait display

Thanks in advance, for your help

about 4 years ago · Juan Pablo Isaza
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!