Skip to main content
CSS-Tricks
  • Articles
  • Notes
  • Links
  • Guides
  • Almanac
  • Picks
  • Shuffle
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 …

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
…
Chris Coyier on Apr 29, 2020
Direct link to the article Gotta Select’em All
selecting text user-select

Gotta Select’em All

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 …

Chris Coyier on Jan 3, 2020
Direct link to the article Force Selection of Text Block
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 …

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
  • About DO
  • Cloudways
  • Legal stuff
  • Get free credit!
CSS-Tricks
  • Contact
  • Write for CSS-Tricks!
  • Advertise with us
Social
  • RSS Feeds
  • CodePen
  • Mastodon
  • Bluesky
Back to Top