Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

208
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda