HTML5 will paste the copy-disabled solution to the long-pressed mobile phone page. html5 page
The solution is as follows:
Directly Add the following code to the CSS file to disable copy and paste on the mobile phone:
Copy XML/HTML Code to clipboard
- *{
- -Webkit-touch-callout: none;/* the default menu of the system is disabled */
- -Webkit-user-select: none;/* webkit browser */
- -Khtml-user-select: none;/* early browsers */
- -Moz-user-select: none;/* Firefox */
- -Ms-user-select: none;/* IE10 */
- User-select: none;
- }
After this code is added, there will be a problem on IOS. At this time, you will find that the input box cannot be entered. This is because-webkit-user-select: none; caused by this attribute.
To solve this problem, set the attribute of input in the css file as follows:
Copy XML/HTML Code to clipboard
- Input {
- -Webkit-user-select: auto;/* webkit browser */
- }
In this way, you can learn from each other and make progress on each other!