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

371
Visualizações
How to styling a card from rectangular to square

everyone, i have a frontend code that displaying card with rectangular but i want to display it in square, please help since i have tried so many time and didn't change to square

const useStyles = makeStyles({
  gridContainer: {
    paddingLeft: "40px",
    paddingRight: "40px",
    // borderWidth:100
  },
  root: {
    // minWidth:50,
    flex:1
  },
  bullet: {
    display: "inline-block",
    margin: "0 2px",
    transform: "scale(0.8)",
  },
  title: {
    fontSize: 14,
  },
  pos: {
    marginBottom: 12,
  },
});

function Home() {

  return (
    <div>
      <div>
        <h1>Product List</h1>
      </div>
      <Grid
            container
            spacing={4}
            className={classes.gridContainer}
            justify="center"
          >
      {getData.map((x, index) => {
        return (
            <Grid key={index} item xs={12} sm={6} md={4} style={{ 
              flex: 1,
              flexDirection: "row",
              justifyContent: "center",
              alignItems: "stretch",
            }}
            >
              <Card className={classes.root} variant="outlined">
                <CardContent>
                  <Typography className={classes.pos} color="textSecondary">
                    <center>
                      {x.sku}
                    </center>
                  </Typography>
                  <Typography className={classes.pos} color="textSecondary">
                    <center>
                      {x.name}
                    </center>
                  </Typography>
                  <Typography className={classes.pos} color="textSecondary">
                    <center>
                      {x.price}
                    </center>
                  </Typography>
                </CardContent>
              </Card>
            </Grid>
        );
      })}
      </Grid>
    </div>
  );
}

From above, it shows that card will display in rectangular

Current output Card

I'm struggle with the styling issue so please advise and correct me if i'm wrong, thanks :)

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