Birrel
Birrel

Reputation: 4834

Disable text cursor within a div

Here are two fiddles: fiddle 1 and fiddle 2

The only difference between the two is one CSS property in .category

-webkit-user-select: none;

When you click and drag one of the elements, the latter fiddle keeps the pointer cursor instead of changing to the text cursor (caret?). I would like that to be the case!

The thing is, when I run the EXACT same HTML, CSS and JS in my browser (outside of JSFiddle), it no longer works and instead behaves like the first fiddle (which I don't want).

I had always understood that JSFiddle inherits the properties of the browser you are using, and so I am curious why the second fiddle works the way I would like it to, but the exact same code does not work when I run it in my browser.

Thoughts? Or maybe solutions to keep the pointer cursor at all times?

Upvotes: 1

Views: 3912

Answers (1)

Mouseroot
Mouseroot

Reputation: 1064

after checking the source of the 3rd and 4th revisions your

-webkit-user-select

doesnt show in the 3rd revision but is visible in the 4th revision so, possibly just a miss-calculation?

enter image description here

Upvotes: 1

Related Questions