国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > CSS > 正文

css 讓文字不被選中之-moz-user-select 屬性介紹

2024-07-11 08:38:54
字體:
供稿:網(wǎng)友

他在ie下也能選中文字,但是選中其他列表,不會選中文字,原來它是在不同div中,屬于不同的范圍,而同事是放在同一個table中,當(dāng)然會選中。
而在firefox下,文字不會被選中,查看google calender的css,原來還有-moz-user-select這個屬性,很好玩!
最后采用一個了js方法,即onselectstart=function{return false;},不讓頁面進(jìn)行選擇,呵呵,這是很多網(wǎng)站不讓復(fù)制采用的方法。

Summary
-moz-user-select is a Mozilla property extension to CSS that is used to determine whether or not an element may have its content selected.

Media: interactive

Possible uses include: prohibiting the selection of content in attempts to reduce blatant copying.

Syntax
TARGET_ELEMENT{-moz-user-select: none;}Legal Values

ValueDescription
inheritInherit the value from the parent element.
noneNone of the content may be selected.
textOnly the text within the element may be selected.
elementA single element may be selected (from many).
elementsMultiple elements may be selected.
allThe contents must either be selected in entirety or none at all.
toggleThe contents are selected "following a standard toggling content model" [1].
tri-stateunknown
-moz-allunknown

Usage Examples

This sample code provides a simple "Hello, World!" text which prevents the user from selecting the content:

<span style="-moz-user-select: none;">
Hello, World!
</span>

Notes

This property is similar to the user-select property of CSS3.

When the ‘none’ value was applied to a heading element the content could still be selected.

According to the W3C, the "User agent’s default style sheet may override this value. For example, user agents typically do not allow selection of the contents of a BUTTON element. [2] As the -moz-user-select was designed to mimic the user-select property, the same applies.

Specification Conformance

Doesn’t conform to CSS standards; A Mozilla CSS Extension.

Browser Compatibility

Netscape 6+
Mozilla 0.6+
Firefox 1.0+

See Also

-moz-user-focus
-moz-user-input
-moz-user-modify

css中的 “-moz-user-select”和“-khtml-user-select”屬性是什麼意思?以及它們的用法?
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 泸水县| 天柱县| 建宁县| 淮滨县| 青州市| 铜川市| 特克斯县| 翁牛特旗| 察隅县| 正阳县| 蓝田县| 湖北省| 襄樊市| 封丘县| 滨海县| 柏乡县| 辽中县| 合阳县| 张家港市| 伊宁市| 许昌县| 莫力| 七台河市| 利津县| 兰考县| 沂南县| 左贡县| 鸡泽县| 镇赉县| 海伦市| 余姚市| 正宁县| 宁都县| 额济纳旗| 长乐市| 张北县| 太仓市| 玉山县| 新邵县| 乳山市| 昌邑市|