Prabodh
Prabodh

Reputation: 175

React button hover css pseudoclass not working

I am making a todo app using react and faunadb. In the main UI there is a button which when hovered on I want to change cursor to pointer. This is the button JSX:

<button className="add-btn"><FontAwesomeIcon icon={faPlus}/></button>

And this is the CSS:

.add-btn:hover{
  cursor: pointer;
}

Upvotes: 0

Views: 596

Answers (2)

Brijesh Gujarati
Brijesh Gujarati

Reputation: 156

<button className="btn hover"><FontAwesomeIcon icon={faPlus}/></button>

add css

.hover:hover{
  cursor: pointer;
}

Upvotes: 0

Konstantin Samarin
Konstantin Samarin

Reputation: 867

Omit :hover, simply declare

.add-btn {
  cursor: pointer;
}

Upvotes: 1

Related Questions