Created
March 23, 2016 09:21
-
-
Save hsleonis/14952c1835af743695fc to your computer and use it in GitHub Desktop.
Make text unselectable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| This is useful in situations where you want to provide an easier/cleaner | |
| copy-paste experience for users (not have them accidentally text-select | |
| useless things, like icons or images). However it's a bit buggy. Firefox enforces | |
| the fact that any text matching that selector cannot be copied. WebKit still | |
| allows the text to be copied if you select elements around it. | |
| Reference: https://css-tricks.com/almanac/properties/u/user-select | |
| */ | |
| .row-of-icons { | |
| -webkit-user-select: none; /* Chrome all / Safari all */ | |
| -moz-user-select: none; /* Firefox all */ | |
| -ms-user-select: none; /* IE 10+ */ | |
| user-select: none; /* Likely future */ | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment