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

182
Visualizações
HexColor does not work in backgroundColor

I have this small code and I have two buttons in it and I want the color of the first button to become green when I point the mouse at it and the color of the second button to become red when I point the mouse at it

But when I put the name of the color within the “backgroundColor” I did not find any problem in the code, but when I put “hex like (#43a047)” it did not work, how can I solve the problem?

const useStyles = makeStyles({
  button1: {
    backgroundColor: "none",
    "&:hover": {
      backgroundColor: "#43a047",
      color: "#e8e4e4",
    },
  },
  button2: {
    backgroundColor: "none",
    "&:hover": {
      backgroundColor: "#e53935",
      color: "#e8e4e4",
    },
  },
});

 <ButtonGroup
              style={{
                // color: "#f8f4fc",
                // backgroundColor: "#282c3c",
                maxWidth: "206px",
                maxHeight: "40px",
                minWidth: "206px",
                minHeight: "40px",
                // marginRight: 10,
              }}
              aria-label="outlined primary button group"
            >
              <Button
                style={{
                  maxWidth: "100px",
                  minWidth: "100px",
                }}
                className={classes.button}
              >
                approve
              </Button>
              <Button
                style={{
                  maxWidth: "100px",
                  minWidth: "100px",
                }}
              >
                reject
              </Button>
            </ButtonGroup>
about 4 years ago · Juan Pablo Isaza
3 Respostas
Responde à pergunta

0

In className={classes.button} you have to use same name as you have in makeStyles.

about 4 years ago · Juan Pablo Isaza Relatório

0

The problem is you have spelled the CSS property wrong. You put backgroundColor: "#43a047"; and it is supposed to be background-color: #43a047;

about 4 years ago · Juan Pablo Isaza Relatório

0

I am not 100% sure how this will be transformed to CSS, but in CSS rules that parameter's name is "background-color", not the JS equivalent "backgroundColor"

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