不可选择的文字(链接)
这个问题在这里已经有了答案:
您可以使用user-select: none;
因此元素和子元素(应用CSS
规则)的文本将无法被选中。
a {
-webkit-touch-callout : none; /* iOS Safari */
-webkit-user-select : none; /* Chrome/Safari/Opera */
-khtml-user-select : none; /* Konqueror */
-moz-user-select : none; /* Firefox */
-ms-user-select : none; /* Internet Explorer/Edge */
}
a {
color: #000;
text-decoration: none
}
a {
-webkit-touch-callout: none;
/* iOS Safari */
-webkit-user-select: none;
/* Chrome/Safari/Opera */
-khtml-user-select: none;
/* Konqueror */
-moz-user-select: none;
/* Firefox */
-ms-user-select: none;
/* Internet Explorer/Edge */
user-select: none;
/* Non-prefixed version, currently not supported by any browser */
}
<!- I want the link text "JS Fiddle" to not be selectable. If I can't make it unselectable at least make it look like an image (select all the text at once)? -->
<a draggable="false" href="https://jsfiddle.net/">JS Fiddle</a>
<br>
<img draggable="false" src="http://i.imgur.com/qdYd7hK.png">
那么你可以使用
a{
pointer-events: none;
cursor: default;
}
a{
color: #000;
text-decoration: none;
pointer-events: none;
cursor: default;
}
<!- I want the link "JS Fiddle" to be not selectable. If I can't make it unselectable at least make it look like an image (select all the text at once)? -->
<a href="https://jsfiddle.net/">JS Fiddle</a>
<br>
<img draggable="false" src="http://i.imgur.com/qdYd7hK.png">
链接地址: http://www.djcxy.com/p/7129.html