Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change appearance of "text-selection" cursor on webpages or disable cursor changing while a text is selected in all major browsers?

I want to prevent the mouse cursor from changing when I move it over some text. Is this possible?

If not, I would like to change the appearance of text-selection cursor - is it possible with css / javascript?

like image 658
Jiří Zmrhal Avatar asked Dec 18 '12 14:12

Jiří Zmrhal


People also ask

How do I turn off text selection on a web page?

You can use the user-select property to disable text selection of an element. In web browsers, if you double-click on some text it will be selected/highlighted. This property can be used to prevent this.

How do I change my text cursor?

Select Start > Settings > Ease of Access > Text cursor. Select Turn on text cursor indicator. Adjust the Change text cursor indicator size slider until it looks like you want in the preview. Select one of the Suggested text cursor indicator colors, or select Pick a custom color to choose your own.


2 Answers

Try this...

* {
  -webkit-user-select: none;
}

*:active,
*:hover {
  cursor: pointer;
}
like image 121
Alex Gill Avatar answered Oct 12 '22 23:10

Alex Gill


I think you are lookings for is the css property "cursor:default;" - but this really depends on what exactly you are looking for. Example with a label:

label{
    cursor:default;
}

Depending on the cursor you want, you can change the value from "default" to something else.

Here's a list of some of the values (Not all - but the most common are there): https://developer.mozilla.org/en-US/docs/CSS/cursor

Remember you get different results depending on browser/OS.

like image 39
Peter Rasmussen Avatar answered Oct 12 '22 23:10

Peter Rasmussen