Beyond user-select: none: the full set of values

user-select: none makes an element's text, including nested text, neither functionally nor visually selectable — ::selection won't render for it either. If a selection spans non-selectable content, that content is left out of the selection. Browser support is strong.

ChromeFirefoxIEEdgeSafari
4*2*10*12*3.1*

Android ChromeAndroid FirefoxAndroidiOS Safari
1571602.1*3.2*

The other values change selection behavior instead of removing it:

  • text — makes content selectable; typically used to override none.
  • all — any attempt to select part of the element selects the whole thing. Convenient where copying is the point (share/embed links, code snippets), since a single click replaces a double-click. Be careful: users may want only part of the content, such as one section of a code snippet or just the font name in a Google Fonts snippet. A JavaScript "copy to clipboard" control often serves those cases better. The strongest fit for all is making sure quotes are copied completely and accurately.
  • contain — a selection that starts inside the element must also end inside it. Oddly, it doesn't apply when the selection begins before the element, which is likely why no browser supports it today. Internet Explorer and older Edge shipped it as user-select: element.
  • auto — the initial value; behavior depends on the element and how it's used.

Where disabling selection earns its keep

Keeping non-text out of copied passages

Readers copy long-form content, not images, emoji (some copy as text, e.g. ":thinkingface:"), or the material usually wrapped in an <aside> — in-article calls to action, ads, and similar. Wrapping those items in an element and applying user-select: none optimizes the selection rather than removing it.

<p>lorem <span style="user-select: none">🤔</span> ipsum</p>

<aside style="user-select: none">
  <h1>Heading</h1>
  <p>Paragraph</p>
  <a>Call to action</a>
</aside>

Note that selecting isn't always copying: many readers highlight as they go to keep their place, like a bookmark — another argument for optimizing instead of disabling.

Text inside a <button> or <input type="submit"> can't be selected, but links don't get that treatment because they traditionally live inside selectable paragraphs. So for a link that looks like a button — <a href="whatever" class="button">Click Me!</a> — apply user-select: none so it behaves like the button it imitates. Whether links should be styled as buttons at all is debatable, but the pattern is widespread, and matching button behavior prevents users from selecting text when they meant to click. Accidental selection is a real problem for people with limited control and coordination, including several medical conditions, so there are accessibility grounds here too. Genuinely drag-based interactions exist — browser games, for instance — but they're uncommon.

Protecting paywalled content

If the content is yours and you want to guard it, user-select: none is one layer among several. Others include blurring the content with CSS:

article { filter: blur(<radius>); }

blocking DevTools keyboard shortcuts:

document.addEventListener("keydown", function (e) {
  if (e.keyCode == 123) e.preventDefault();
  else if ((e.ctrlKey || e.metaKey) && e.altKey && e.keyCode == 73) e.preventDefault();
  else if ((e.ctrlKey || e.metaKey) && e.altKey && e.keyCode == 74) e.preventDefault();
  else if ((e.ctrlKey || e.metaKey) && e.altKey && e.keyCode == 85) e.preventDefault();
});

disabling the context menu, and with it DevTools access through it:

document.addEventListener("contextmenu", e => e.preventDefault())

and finally preventing copying at the source:

<article style="user-select: none">