Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

199
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda