[CSS] Select text with one click

This trick is inclined towards improving copy and paste experience for website users. Using user-select: all, you can enable easy text selection with one click. All text node below that element is selected.

On the other hand, you can disable text selection with user-select: none;. Alternative way to disable text selection is placing text inside content: ''; property of ::before or ::after CSS pseudo element.

 

Read More: https://dev.to/smitterhane/13-css-tricks-that-will-give-you-an-adrenaline-rush-5908

posted @ 2023-07-20 00:37  Zhentiw  阅读(16)  评论(0)    收藏  举报