一共两种方法
第一种是直接在Body里面实现,鼠标是无法选中文字的
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>网页文字不能复制</title>
</head>
<body oncontextmenu="return false" onselectstart="return false" oncopy="return false">
<ul>
<p>他找若是同淋雪, 此生也算共白头</p>
<p>I really want to be with you all my life</p>
</ul>
</body>
</html>
第二种使用JS实现,这种的实现方法,鼠标是可以选中文字 但是不能进行复制
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>网页文字不能复制</title>
<script>
document.oncontextmenu = function(){
return false;
}
document.onkeydown = function(){
if (event.ctrlKey && window.event.keyCode==67){
return false;
}
}
document.body.oncopy = function (){
return false;
}
document.onselectstart = function(){
//return false;
}
</script>
</head>
<body>
<ul>
<p>他找若是同淋雪, 此生也算共白头</p>
<p>I really want to be with you all my life</p>
</ul>
</body>
</html>