Tuesday, 5 July 2016

Disable text selection in web page using CSS

Hi there, today i m share code for disable text selection using css, there are not require jquery or javascript.you can disable text selection in whole page or user defined div,

this code will disable text selection for whole page.im using .body for disable text select for whole page
   
.body
{
 -webkit-touch-callout: none; /* For IOS Safari */
 -webkit-user-select: none; /* For Safari/Opera/Chrome */ 
 -khtml-user-select: none; /* For Konqueror */ 
 -moz-user-select: none; /* For Firefox */
 -ms-user-select: none; /* For Internet Explorer/Edge */ user
 -select: none; /* For non-prefixed version */
 }

this code will disable text selection for div.

.div
{ 
 -webkit-touch-callout: none; /* For IOS Safari */
 -webkit-user-select: none; /* For Safari/Opera/Chrome */ 
 -khtml-user-select: none; /* For Konqueror */ 
 -moz-user-select: none; /* For Firefox */
 -ms-user-select: none; /* For Internet Explorer/Edge */ user
-select: none; /* For non-prefixed version */
 }

Related Articles

0 comments:

Post a Comment

Prompt Web Solution. Powered by Blogger.