CSS - change cursor on hover

0 points
Created by:

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>

    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			*/

  <div>Hover me.</div>
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.

❤️💻 🙂