October 29, 2012

Disable Text Selection In CSS

If you’re using text or images as buttons, sometimes clicking them multiple times will trigger a text selection of the element, distorting the visual appeal. You can use the following css on the elements class to disable text selection of the element.

-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;

Leave a Reply

Your email address will not be published. Required fields are marked *

css.php