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

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

WBOY
Release: 2016-06-01 09:53:24
Original
1358 people have browsed it

代码如下:

<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>
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template