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

177
Vistas
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 Respuestas
Responde la pregunta

0

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

about 4 years ago · Juan Pablo Isaza Denunciar

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 Denunciar

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 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