- How to disable text selection on a page website?
SOLUTION: Ref: How to disable text selection highlighting using CSS?
Use user-select.
123456789101112131415.noselect {-webkit-touch-callout: none; /* iOS Safari */-webkit-user-select: none; /* Chrome/Safari/Opera */-khtml-user-select: none; /* Konqueror */-moz-user-select: none; /* Firefox */-ms-user-select: none; /* Internet Explorer/Edge */user-select: none; /* Non-prefixed version, currentlynot supported by any browser */}<p>Selectable text.</p><p class="noselect">Unselectable text.</p>
Or in body selector (css):
123456body{-moz-user-select: none;-khtml-user-select: none;user-select: none;}
Then also putĀ onselectstart=”return false” in body tag (html):
123<body onselectstart="return false" style="margin-top: 0px;" bgcolor="#DDDDDD">...</body>
Local file: /media/data/MASTER/oDesk/test_answer/php-694.html
/media/data/MASTER/oDesk/test_answer/php-694_files/phpkb.css