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

209
Vistas
Center list items horizontally across various widths

I have this container:

export const Container = styled.section<ContainerProps>`
  display: flex;
  justify-content: center;
`;

Which is centering my 3 list items vertically. No matter the width of the page, it's always in the center. I'm trying to achieve the same effect but horizontally. I've tried using float: left; along with controlling the margins and that does work but then the problem is that it doesn't change dynamically with different widths (mobile).

I'm using the following the style the cards within the container. As I have said, it's 3 cards:

export const Card = styled.article`
  border-radius: 50px;
  border: solid 1px #e6e6e6;
  font-size: 12px;
  box-shadow: 5px 10px 10px grey;
`;


This is the section of the return in the component:


        if (name !== null) {
          return (
            <Container>
              <Card>
                <CollectionAvatar
                  image={image}
                  /*name={name || collection}*/
                  type="collection"
                />
                <br></br>
                <br></br>
                {name}
              </Card>
            </Container>
          );
        }
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This code should work for centering a div on a page horizontally and align the children in a row.

   .card {
  border-radius: 50px;
  border: solid 1px #e6e6e6;
  font-size: 12px;
  box-shadow: 5px 10px 10px grey;
}

.container {
  display: flex;
  justify-content: center;

}

<div class="container">

<div class="card">
  <br></br>
  <br></br>
  {name}
</div>

<div class="card">
  <br></br>
  <br></br>
  {name}
</div>

<div class="card">
  <br></br>
  <br></br>
  {name}
</div>

enter image description here

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