2

I tried using cursor:pointer to my div but still I get the default cursor type on hovering it. What am I doing wrong?

I checked other live sites also, this problem resides all over. Not sure whether it has been deprecated or I'm doing something wrong.

div{
  width:100px;
  height:100px;
  background:red;
}
div:hover{
  cursor:pointer
}
<div>

</div>
unor
  • 92,415
  • 26
  • 211
  • 360
Santhosh Kumar
  • 1,672
  • 1
  • 16
  • 26

4 Answers4

1

As you may check in here, this is not deprecated. Browser compatibility information is also present on this web site.

You can check the compatibility with this web site. to get the full info.

555
  • 147
  • 8
1

Thanks for your swift response. You guys wont believe it. As suggested by luciferous in the comment. I tried tring off photoshop. It worked like a GEM. But dunno what could be the reason for photoshop turning off to deal with browser cursor pointer. But still issue has been resolved. This might be funny solution but it worked

Santhosh Kumar
  • 1,672
  • 1
  • 16
  • 26
0

Use

div:hover{
    cursor: pointer;
    cursor: hand;
}

By using two properties repeatedly, the one with the invalid/not supported value will be ignored as per css spec, and the next line will be executed.

I'm using this for years, since the netscape navigator/internet explorer wars, and aparently sometimes it's still needed to use both.

Tschallacka
  • 27,901
  • 14
  • 88
  • 133
0

Cursor pointer is not depricated, it might be some bug in your browser. In this example you can differentiate between cursor type. Also check this website for reference

#a1{
  width:100px;
  height:100px;
  background:red;
}
#a2{
  width:100px;
  height:100px;
  background:blue;
}
#a3{
  width:100px;
  height:100px;
  background:green;
}
#a3:hover{
  cursor:default
}
#a2:hover{
  cursor:pointer
}
#a1:hover{
  cursor:help
}
<div id="a1">

</div>
<div id="a2">

</div >
<div id="a3">

</div >
neophyte
  • 6,540
  • 2
  • 28
  • 43