Languages
[Edit]
EN

CSS - change cursor on hover

0 points
Created by:
Giles-Whittaker
739

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>

Alternative titles

  1. CSS - change cursor into hand when user hovers over element
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
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