+ 4

How to make html page not selectable

23rd Oct 2018, 3:13 AM
Amar Dahake
7 ответов
+ 4
For other browser exept chrome and opera. * { -webkit-touch-callout: none; /* iOS Safari */ -webkit-user-select: none; /* Safari */ -khtml-user-select: none; /* Konqueror HTML */ -moz-user-select: none; /* Firefox */ -ms-user-select: none; /* Internet Explorer/Edge */ user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */ }
23rd Oct 2018, 3:44 AM
Googel
Googel - avatar
+ 5
<!DOCTYPE html> <html> <head> <style> * { user-select: none; } </style> <title>Page Title</title> </head> <body> Some text </body> </html>
23rd Oct 2018, 3:28 AM
Googel
Googel - avatar
+ 4
Using JQuery <!DOCTYPE html> <html> <head> <title>Page Title</title> <script src="https://code.jquery.com/jquery-3.1.1.js"></script> </head> <body> Hello World <script> $(function() { $("body").on("selectstart",function(e){ e.preventDefault(); }) }); </script> </body> </html>
23rd Oct 2018, 3:40 AM
Googel
Googel - avatar
+ 3
Brent Meeusen thank you 🙂 this library makes life easier
23rd Oct 2018, 12:00 PM
Amar Dahake
+ 3
in css: user-select:none;
24th Oct 2018, 1:15 AM
Jingga Sona
Jingga Sona - avatar
23rd Oct 2018, 3:31 AM
Amar Dahake