Hover Effect

<!DOCTYPE html>
<html>
<head>
  <style>
button {
  background: green;
  color: white;
  padding: 10px;
  border: none;
  cursor: pointer;
}
button:hover {
  background: darkgreen; /* Changes color when hovered */
}
</style> </head> <body> <button>Hover Me</button> </body> </html>

Explanation:

  • :hover applies style when the mouse is over the element.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *