Home  >  Article  >  Web Front-end  >  CSS如何实现禁止选中文本_html/css_WEB-ITnose

CSS如何实现禁止选中文本_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:36:58808browse

CSS如何实现禁止选中文本:
禁止文本被选中的目的一般是为了防止别人复制网站的内容,当然这些只能防住一些“善良”的朋友,只要有点web知识都能够轻易破解这些,不过咱们不管这些,只要客户有需要,程序员就必须要实现,下面是两端css样式代码,能够实现此功能,希望能够对需要的朋友带来一定的帮助。
代码如下:

 

div{   text-align:center;   vertical-align:middle;   height:39px;   overflow:hidden;   moz-user-select:-moz-none;   -moz-user-select:none;   -o-user-select:none;   -khtml-user-select:none;   -webkit-user-select:none;  -ms-user-select:none;   user-select:none;}

 

以上代码可以实现禁止div中的文本被选中。
但是美中不足的是,IE10以下浏览器并不支持此效果。

原文地址是:http://www.softwhy.com/forum.php?mod=viewthread&tid=8909

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn