禁止用户选择文字
![](https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif)
<style>
.disable-text-selection
{
/* Mozilla */
-moz-user-select:none;
/*safari & chrome
Available in Safari 3.0 and later. (Called -khtml-user-select in Safari 2.0.)
Available in iPhone OS 3.0 and later.
*/
-webkit-user-select:none;
-khtml-user-select:none;
/*
CSS 3
*/
user-select: none;
/*
HTML Attribute unselectable="on"
IE 5.5+
Opera ?
*/
}
</style>
<div class="disable-text-selection" unselectable="on">
咩哈哈哈哈哈哈哈
</div>
.disable-text-selection
{
/* Mozilla */
-moz-user-select:none;
/*safari & chrome
Available in Safari 3.0 and later. (Called -khtml-user-select in Safari 2.0.)
Available in iPhone OS 3.0 and later.
*/
-webkit-user-select:none;
-khtml-user-select:none;
/*
CSS 3
*/
user-select: none;
/*
HTML Attribute unselectable="on"
IE 5.5+
Opera ?
*/
}
</style>
<div class="disable-text-selection" unselectable="on">
咩哈哈哈哈哈哈哈
</div>