Languages
[Edit]
EN

CSS - change cursor on hover

0 points
Created by:
Giles-Whittaker
349

In this article, we would like to show you how to change the cursor on hover in CSS.

Quick solution:

div {
  cursor: pointer;
}

 

Practical example

In this example, we use the  cursor: pointer; to change the mouse cursor within the div element on the hover event.

// ONLINE-RUNNER:browser;

<!doctype html>
<html>
<head>
  <style>

    div {
      height: 100px;
      width: 100px;
      color: #28a745;
      border: 1px solid #28a745;
      border-radius: 10px;
      display: flex;
      justify-content: center;
      align-items: center;
 
      cursor: pointer;		/*		<----- required			*/
    }

  </style>
</head>
<body>
  <div>Hover me.</div>
</body>
</html>
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join