|
|
Disabling Text Selection in web page - Stop highlight - CSS
|
Views : 5189
|
|
Tagged in : CSS
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
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 |
|
|
|