如何禁用文本選擇突出顯示 - How to disable text selection highlighting

問題:

For anchors that act like buttons (for example, Questions , Tags , Users , etc. at the top of the Stack Overflow page) or tabs, is there a CSS standard way to disable the highlighting effect if the user accidentally selects the text? 對於充當按鈕的錨(例如,「堆棧溢出」頁面頂部的「 問題」 ,「 標籤」 ,「 用戶 」等)或選項卡,是否存在CSS標準方法來禁用突出顯示效果(若是用戶不當心選擇了文本)? app

I realize this could be done with JavaScript, and a little googling yielded the Mozilla-only -moz-user-select option. 我意識到能夠使用JavaScript來完成此操做,而且通過一番搜尋後發現了僅Mozilla的-moz-user-select選項。 ide

Is there a standard-compliant way to accomplish this with CSS, and if not, what is the "best practice" approach? 是否有使用CSS來實現此目標的符合標準的方法,若是沒有,「最佳實踐」方法是什麼? this


解決方案:

參考一: https://stackoom.com/question/3T5C/如何禁用文本選擇突出顯示
參考二: https://oldbug.net/q/3T5C/How-to-disable-text-selection-highlighting
相關文章
相關標籤/搜索