function

moz image rect() — CSS reference

Removed Mozilla-specific background image crop function; historically took a URL and top, right, bottom, left coordinates. Firefox 120 removed it. A background sprite can instead use explicit size and position with a clipped box. This example uses a two-color gradient as a local sprite.

Formal Syntax & Structure

css syntaxcss
-moz-image-rect(url("sprite.png"), 0, 40, 40, 0)

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>-moz-image-rect()</title><style>body{margin:0;background:white}#a{box-sizing:border-box}#a{width:40px;height:40px;background-image:linear-gradient(to right,red 50%,blue 50%);background-size:80px 40px;background-position:right top;background-repeat:no-repeat;background-image:-moz-image-rect(url("sprite.png"),0,40,40,0)}</style><body><div id="a">Example</div></body></html>
CSS Reference