How to disable text selection highlighting

asked16 years ago
last updated3 years ago
viewed2.6m times
Up Vote6kDown Vote

For anchors that act like buttons (for example, the buttons on the sidebar of this Stack Overflow page titled , , and ) or tabs, is there a CSS standard way to disable the highlighting effect if the user accidentally selects the text? I realize that this could be done with JavaScript and a little googling yielded the Mozilla-only -moz-user-select option. Is there a standard-compliant way to accomplish this with CSS, and if not, what is the "best practice" approach?