双击时如何停止突出显示div元素 [英] How to stop highlighting of a div element when double-clicking

查看:130
本文介绍了双击时如何停止突出显示div元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带背景图像的div元素,我想在双击它时停止在div元素上突出显示.是否有CSS属性?

I have this div element with a background image and I want to stop highlighting on the div element when double-clicking it. Is there a CSS property for this?

推荐答案

下面的CSS阻止用户选择文本.实时示例: http://jsfiddle.net/hGTwu/20/

The CSS below stops users from being able to select text. Live example: http://jsfiddle.net/hGTwu/20/

-webkit-user-select: none; /* Chrome/Safari */        
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+ */

/* Rules below not implemented in browsers yet */
-o-user-select: none;
user-select: none;

要向下定位IE9和Opera,必须改用html属性unselectable:

To target IE9 downwards and Opera the html attribute unselectable must be used instead:

<div unselectable="on">Test Text</div>

这篇关于双击时如何停止突出显示div元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆