Open main menu

CDOT Wiki β

Difference between revisions of "CSS GUIDE -MOZ-USER-SELECT"

(Legal Values)
(Legal Values)
 
(8 intermediate revisions by the same user not shown)
Line 8: Line 8:
 
== Syntax ==
 
== Syntax ==
 
<pre>
 
<pre>
<!-- TARGET_ELEMENT{-moz-user-modify: inherit;}
+
TARGET_ELEMENT{-moz-user-select: none;}
TARGET_ELEMENT{-moz-user-modify: read-only;}
 
TARGET_ELEMENT{-moz-user-modify: read-write;}
 
TARGET_ELEMENT{-moz-user-modify: write-only;} -->
 
 
</pre>
 
</pre>
  
Line 23: Line 20:
 
<tr><td>elements</td><td>Multiple elements may be selected.</td></tr>
 
<tr><td>elements</td><td>Multiple elements may be selected.</td></tr>
 
<tr><td>all</td><td>The contents must either be selected in entirety or none at all.</td></tr>
 
<tr><td>all</td><td>The contents must either be selected in entirety or none at all.</td></tr>
<tr><td>toggle</td><td></td></tr>
+
<tr><td>toggle</td><td>The contents are selected "following a standard toggling content model" [http://www.blooberry.com/indexdot/css/properties/extensions/nsextensions.htm].</td></tr>
<tr><td>tri-state</td><td></td></tr>
+
<tr><td>tri-state</td><td>unknown</td></tr>
<tr><td>-moz-all</td><td></td></tr>
+
<tr><td>-moz-all</td><td>unknown</td></tr>
 
</table>
 
</table>
  
 
== Usage Examples ==
 
== Usage Examples ==
 +
This sample code provides a simple "Hello, World!" text which prevents the user from selecting the content:
 +
<pre>
 +
<span style="-moz-user-select: none;">
 +
Hello, World!
 +
</span>
 +
</pre>
  
 
== Notes ==
 
== Notes ==
 
This property is similar to the [http://www.w3.org/TR/1999/WD-css3-userint-19990916#user-select user-select] property of CSS3.
 
This property is similar to the [http://www.w3.org/TR/1999/WD-css3-userint-19990916#user-select 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 <i>"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.</i> [http://www.w3.org/TR/1999/WD-css3-userint-19990916#user-select]  As the -moz-user-select was designed to mimic the user-select property, the same applies.
  
 
== Specification Conformance  ==
 
== Specification Conformance  ==

Latest revision as of 00:58, 14 December 2006

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

References