7

Possible Duplicate:
css rule to disable text selection highlighting

On my homepage i have a script, which shows a clock at the top of my homepage. I dont like the fact that i can choose this clock with my mouse, see the picture.

So i want to know if there is a way to completely prevent an html element from being selected by the mouse.

0

1 Answer 1

15

CSS can do that.

-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
Sign up to request clarification or add additional context in comments.

4 Comments

the simplicity and power of CSS XD
One more thing... why there are 5 lines :S ???
One for each browser engine (Chrome,Safari = webkit, Chrome 1.0 = khtml, Firefox = moz, Opera = o) and one for those who implement the CSS3 spec correctly.
@Tom -So the last one is obsolete ? :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.