問題:
This question already has an answer here: 這個問題在這裏已有答案:
- How to disable text selection highlighting 41 answers 如何禁用文本選擇突出顯示 41個答案
I would like to add text to my webpage as a label and make it unselectable. 我想在我的網頁上添加文字作爲標籤並使其無法選擇。
In other words, When the mouse cursor is over the text I would like it to not turn into a text selecting cursor at all. 換句話說,當鼠標光標在文本上方時,我希望它根本不會變成文本選擇光標。
A good example of what I'm trying to achieve is the buttons on this website (Questions,Tags,Users,...) 我想要實現的一個很好的例子就是這個網站上的按鈕(問題,標籤,用戶......)
解決方案:
參考一: https://en.stackoom.com/question/9h7u參考二: https://stackoom.com/question/9h7u