Feb 8, 2013

How to Disable Selection and Copy Paste Only Blog Post

This is very important code for disabling selection and copy  of the blog post.
Put this code above </head> to deactivate copy paste of blog post only. 

.post-body {

  -webkit-user-select: none;  /* Chrome all / Safari all */
  -moz-user-select: none;     /* Firefox all */
  -ms-user-select: none;      /* IE 10+ */
  -o-user-select: none;
  user-select: none;         

This code can also be put in extenral css file eg mystyle.css. And this is to imported into head section of the source code ie above </head>. The imported code may be like this.

<link href='https://itg-js-and-css-akb.googlecode.com/svn/trunk/mystyle.css' rel='stylesheet' type='text/css'/>

No comments:

Post a Comment