Home  >  Article  >  Web Front-end  >  CSS如何实现文本禁止被选中

CSS如何实现文本禁止被选中

WBOY
WBOYOriginal
2016-06-01 09:53:241341browse

代码如下:

<code class="language-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;
}</code>

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

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