Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

174
Views
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 answers
Answer question

0

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

about 4 years ago · Juan Pablo Isaza Report

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!