Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent highlighter cursor in CSS?

I'm using <a> to make text that can be clicked and used for jQuery. I've already got CSS to make it un-highlightable:

-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
text-decoration: none;

But it still changes to the cursor shaped like a serifed "I" when it's hovered, like text usually does. Is there any way to prevent this, and preferably change it to the "hand" cursor that links normally cause? The only thing I thought of was having an invisible div on top, but that would make them unclickable, and it would keep the normal pointer.

like image 301
tkbx Avatar asked Mar 09 '13 17:03

tkbx


1 Answers

Simply use the cursor property on hover.

a:hover {
    cursor: pointer;
}

You can see the available cursor values here.

Example http://jsfiddle.net/8nyEE/

<a class="hand">link with hand cursor</a>

<br/><br/>

<a class="nohand">link with default cursor</a>
a {color: blue;}

.hand:hover {
   cursor: pointer;
}

.nohand:hover {
   cursor: default;
}
like image 115
ktm5124 Avatar answered Oct 19 '22 19:10

ktm5124