CSS3控制无法选择文本

2012-07-20 00:07

CSS3控制无法选择文本

by Airen

at 2012-07-19 16:07:51

original http://www.w3cplus.com/codes/unselect-able-with-css3.html

有时候大家想让你的用户无法直接从页面中copy你的内容,做起来好麻烦的,CSS3的“user-select”帮你实现这样的效果,请看一段简单的代码:

.unselectable {
   -moz-user-select: -moz-none;
   -khtml-user-select: none;
   -webkit-user-select: none;
   -o-user-select: none;
   user-select: none;
}