-moz-image-region

  • Revision slug: CSS/-moz-image-region
  • Revision title: -moz-image-region
  • Revision id: 145442
  • Created:
  • Creator: KaiRo
  • Is current revision? No
  • Comment /* Examples */

Revision Content

{{template.CSSMozExtensionRef()}}

Summary

For certain XUL elements and pseudo-elements that use an image from the {{template.Cssxref("list-style-image")}} property, this property specifies a region of the image that is used in place of the whole image. This allows elements to use different pieces of the same image to improve performance.

The syntax is similar to the {{template.Cssxref("clip")}} property. All four values are relative to the upper left corner of the image.

  • Initial value: auto
  • Applies to: XUL {{template.XULElem("image")}} elements and {{template.Cssxref(":-moz-tree-image")}}, {{template.Cssxref(":-moz-tree-twisty")}}, and {{template.Cssxref(":-moz-tree-checkbox")}} pseudo-elements
  • Inherited: yes
  • Percentages: N/A
  • Computed value: For rect() values, a rect consisting of four computed lengths; otherwise as specified.

Syntax

-moz-image-region: rect(top, right, bottom, left);

Examples

#example-button {
  /* display only the 4x4 area from the top left of this image */
  list-style-image: url("chrome://example/skin/example.png");
  -moz-image-region: rect(0px, 4px, 4px, 0px);
}
{{ wiki.languages( { "fr": "fr/CSS/-moz-image-region", "pl": "pl/CSS/-moz-image-region" } ) }}

Revision Source

<p> 
{{template.CSSMozExtensionRef()}}
</p>
<h3 name="Summary"> Summary </h3>
<p>For certain XUL elements and pseudo-elements that use an image from the {{template.Cssxref("list-style-image")}} property, this property specifies a region of the image that is used in place of the whole image.  This allows elements to use different pieces of the same image to improve performance.
</p><p>The syntax is similar to the {{template.Cssxref("clip")}} property. All four values are relative to the upper left corner of the image.
</p>
<ul><li> Initial value: <code>auto</code>
</li><li> Applies to: XUL {{template.XULElem("image")}} elements and {{template.Cssxref(":-moz-tree-image")}}, {{template.Cssxref(":-moz-tree-twisty")}}, and {{template.Cssxref(":-moz-tree-checkbox")}} pseudo-elements
</li><li> Inherited: yes
</li><li> Percentages: N/A
</li><li> Computed value: For <code>rect()</code> values, a rect consisting of four computed lengths; otherwise as specified.
</li></ul>
<h3 name="Syntax"> Syntax </h3>
<pre class="eval">-moz-image-region: rect(<i>top</i>, <i>right</i>, <i>bottom</i>, <i>left</i>);
</pre>
<h3 name="Examples"> Examples </h3>
<pre>#example-button {
  /* display only the 4x4 area from the top left of this image */
  list-style-image: url("chrome://example/skin/example.png");
  -moz-image-region: rect(0px, 4px, 4px, 0px);
}
</pre>
{{ wiki.languages( { "fr": "fr/CSS/-moz-image-region", "pl": "pl/CSS/-moz-image-region" } ) }}
Revert to this revision