【html】css、js實現網頁內容禁止選中

網頁內容不能選中、複製應該如何實現呢?css

經過csshtml

*{
moz-user-select: -moz-none;
-moz-user-select: none;
-o-user-select:none;
-khtml-user-select:none;
-webkit-user-select:none;
-ms-user-select:none;
user-select:none;
}

經過body標籤web

<body οncοntextmenu="return false;" onselectstart="return false">
//前面一句是禁止右鍵,後面一句是禁止複製。

經過jshtm

//禁止頁面選擇以及鼠標右鍵
document.οncοntextmenu=function(){return false;}; 
document.onselectstart=function(){return false;};
相關文章
相關標籤/搜索