CSS3实现的禁止文本选中代码实例:
本章节介绍一下如何利用css3实现禁止文本选中效果,代码如下:
<!DOCTYPE html> <html> <head> <meta charset=" utf-8"> <meta name="author" content="http://www.softwhy.com/" /> <title>蚂蚁部落</title> <style type="text/css"> div{ -moz-user-select:none; -webkit-user-select:none; -ms-user-select:none; -khtml-user-select:none; user-select:none; } </style> </head> <body> <div>蚂蚁部落</div> </body> </html>
以上代码可以设置div中的文本禁止选中效果。
原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=13840
更多内容可以参阅:http://www.softwhy.com/divcss/