Disabling Text Selection in web page - Stop highlight - CSS Views : 5189
Tagged in : CSS
1 0
Send mail
I have faced a text selection issue, when i enable click and drag in a web page. When i dragged an element the text in web page are selected.This issue is solved by adding a CSS property -moz-user-select: none . This property works in FireFox only. The text selection issue in IE can be solved by adding a event called onselectstart

Example : To disable text selection for a div element

This is test. try selecting this line.....

it wont be highlighted while you select it..


Code :

<div onselectstart="return false;" style="-moz-user-select: none;">


Create Your Own Website / Host Your Website @ HIOXINDIA
By Selva, On - 2008-08-29



    Login to add Comments .