日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

html入门moz a,css 让文字不被选中之-moz-user-select 属性介绍

發(fā)布時間:2024/10/14 编程问答 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 html入门moz a,css 让文字不被选中之-moz-user-select 属性介绍 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

他在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

Value

Description

inherit

Inherit the value from the parent element.

none

None of the content may be selected.

text

Only the text within the element may be selected.

element

A single element may be selected (from many).

elements

Multiple elements may be selected.

all

The contents must either be selected in entirety or none at all.

toggle

The contents are selected "following a standard toggling content model" [1].

tri-state

unknown

-moz-all

unknown

Usage Examples

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

Hello, World!

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”屬性是什麼意思?以及它們的用法?

h1{

-moz-user-select:-moz-none;

}

這里在firefox中會顯示不同

屏蔽選擇的樣式定義:-moz-user-select屬性(只支持ff)。

屬性有三個屬性值:

1、 none:用none,子元素所有的文字都不能選擇,包括input輸入框中的文字也不能選擇。

2、 -moz-all:子元素所有的文字都可以被選擇,但是input輸入框中的文字不可以被選擇。

3、 -moz-none:子元素所有的文字都不能選擇,但是input輸入框中的文字除外。

IE瀏覽器下是通過 onselectstart=”javascript:return false;”事件來實現(xiàn)該功能。

-khtml-是蘋果的那個瀏覽器的 好像現(xiàn)在使用-webkit-user-select: none

總結(jié)

以上是生活随笔為你收集整理的html入门moz a,css 让文字不被选中之-moz-user-select 属性介绍的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。