Disable selection

CSS, Interactivity · Dec 30, 2020

Makes the content unselectable.

  • Use user-select: none to make the content of the element not selectable.
  • Note: This is not a secure method to prevent users from copying content.
<p>You can select me.</p>
<p class="unselectable">You can't select me!</p>
.unselectable {
  user-select: none;
}

More like this

  • Tip: The perfect duration for CSS transitions

    Learn how to make your CSS transitions feel perfect when users interact with elements on the page with this simple tip.

    CSS, Interactivity · Jun 12, 2021

  • Horizontal scroll snap

    Creates a horizontally scrollable container that will snap on elements when scrolling.

    CSS, Interactivity · Oct 11, 2021

  • Vertical scroll snap

    Creates a scrollable container that will snap on elements when scrolling.

    CSS, Interactivity · Aug 18, 2020