0

I have 2 different hovering Effects on a button. The one with the .Red class works perfectly fine but the general .Button class doesn't.

.Button {
  background-color: green;
  color: white;
  font: inherit;
  border: 1px solid blue;
  padding: 8px;
  cursor: pointer;
};
//this one doesn't work
.Button:hover {
  background-color: lightgreen;
  color: black;
}

.Button.Red {
  background-color: red;
}

.Button.Red:hover {
  background-color: salmon;
  color: black;
}
<button class="Button">Click Me</button>

<button class="Button Red">Click Me</button>

2
  • Please add your HTML to the question as well so we can reproduce the issue. Commented Feb 24, 2021 at 21:49
  • Thank you for pointing this out. I will be doing this moving forward. Commented Feb 26, 2021 at 22:56

1 Answer 1

1

You have a ";" after "}" remove it and it should work.

.Button {
  background-color: green;
  color: white;
  font: inherit;
  border: 1px solid blue;
  padding: 8px;
  cursor: pointer;
};
Sign up to request clarification or add additional context in comments.

1 Comment

OMG i can't believe that i actually missed that one! Thank you so much! It is working now :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.