---
title: "让网页内容不可以复制和滚动条样式"
author: "bepatient"
date: "2011-02-06T20:27:33Z"
tags: []
categories: ["Web前端"]
slug: "untitled"
draft: false
lastmod: "2011-02-06T20:27:33Z"
id: 901377
url: "https://bepatient.iteye.com/blog/901377"
---

让网页内容不可以复制：

```
<script>
	document.oncontextmenu =function(){return false;};
	document.onmousedown = function(){return false;};
	document.ondragstart =function(){return false;}; 
	document.onselectstart =function(){return false;};
	document.onselect =function(){return false;}; 
	document.oncopy =function(){return false;};
	document.onbeforecopy =function(){return false;}; 
	document.onmousemove =function(){return false;};
</script>
```

 

滚动条样式：

```
body（/html）{ 
FONT-SIZE: 12px;
 margin-right:0;
 padding-right:0;
 margin-left:0;
 scrollbar-base-color:#C9EBFF;
 scrollbar-face-color:#C9EBFF;
 scrollbar-track-color:#C9EBFF;
 scrollbar-arrow-color:#0099CD;
 scrollbar-3dlight-color:#0099CD;
 scrollbar-highlight-color:#C9EBFF;
 scrollbar-shadow-color:#0099CD;
 scrollbar-darkshadow-color:#C9EBFF;
}

```