Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I add cursor:pointer to pseudo class :hover or not?

I don't know, what should I use

.myclass {
  cursor: pointer;
}

or

.myclass:hover {
  cursor: pointer;
}

Or there is no difference?

like image 781
anony_root Avatar asked Jun 16 '26 15:06

anony_root


2 Answers

Use whatever you want.
I'd use the first one for it will save me a few lines of CSS

Otherwise you can specify a different pointer for all other pseudo classes.

like:

a:link{cursor:pointer;} /* you still dont need it ... as it's default*/
a:hover{cursor:crosshair;}
a:active:{cursor:wait;}
a:visited{cursor:wait;}
like image 55
Roko C. Buljan Avatar answered Jun 19 '26 07:06

Roko C. Buljan


There is no difference - the cursor will change in either case.

like image 21
Nightfirecat Avatar answered Jun 19 '26 07:06

Nightfirecat