I`ve tried to use a class as a hover selector in my own project, and it worked.
However, in the sample project of ‘Building a landing page’ (https://codepen.io/freeCodeCamp/full/RKRbwL).
Why can`t I replace the code of
#hero input[type="submit"]:hover {
background-color: orange;
transition: background-color 1s;
}
and
.product > button:hover {
background-color: orange;
transition: background-color 1s;
}
to
.btn:hover {
background-color: orange;
transition: background-color 1s;
}
?
Both ‘input[type=“submit”]’ and ‘button’ mentioned above have the same class of ‘btn’.