Skip to main content
CSS-Tricks
  • Articles
  • Videos
  • Almanac
  • Newsletter
  • Guides
  • DigitalOcean
  • DO Community
Search

Articles Tagged
user-select

4 Articles
{
,

}
Direct link to the article When is it OK to Disable Text Selection?
::selection user-select

When is it OK to Disable Text Selection?

Using CSS, it’s possible to prevent users from selecting text within an element using user-select: none. Now, it’s understandable why doing so might be considered “controversial”. I mean, should we be disabling standard user behaviors? Generally speaking, no, we …

Avatar of Daniel Schwarz
Daniel Schwarz on Sep 14, 2022 (Updated on Sep 15, 2022)
Direct link to the article Click Once, Select All; Click Again, Select Normally
user-select

Click Once, Select All; Click Again, Select Normally

A bonafide CSS trick from Will Boyd!

  1. Force all the content of an element to be selected when clicked with user-select: all;
  2. If you click a second time, let the user select just parts of the text as normal.
  3. Second
…
Avatar of Chris Coyier
Chris Coyier on Apr 29, 2020
Direct link to the article Gotta Select’em All
selecting text user-select

Gotta Select’em All

Direct Link

I suspect it is not highly known that CSS can control how text is selected. You can do user-select: none; to prevent some text from being selected. That’s probably not terribly good UX in general, but perhaps you use some …

Avatar of Chris Coyier
Shared by Chris Coyier on Jan 3, 2020
selecting text user-select

Force Selection of Text Block

Have you ever seen (or put yourself) some text into a <textarea></textarea> or <input />, not because it was part of a form, but because it made the whole block of text easier to select. Inputs like that have …

Avatar of Chris Coyier
Chris Coyier on Aug 11, 2016

CSS-Tricks is powered by DigitalOcean.

Keep up to date on web dev

with our hand-crafted newsletter

DigitalOcean
  • DigitalOcean
  • DigitalOcean Community
  • About DigitalOcean
  • Legal
  • Agency Coaching
  • Free Credit Offer
CSS-Tricks
  • Email
  • Guest Writing
  • Book
  • Advertising
Follow
  • Mastodon
  • Twitter
  • Instagram
  • YouTube
  • CodePen
  • iTunes
  • RSS
Back to Top