
Firefox 3.6 adds background clipping
- Transfer
- Tutorial
In addition to all the new CSS features we mentioned earlier , Firefox 3.6 * takes on the freshest new property value: image-rect . This will allow you to cut out the area of the background image to show only part of the whole.
It uses the Mozilla proprietary prefix(that is, “-moz-” - approx. Transl.) And takes a pair of input values - the URI of the image and the border of the cut-out area (in the form of four values separated by commas, as in the clip property ):
Here is an example:
The most immediate application of this will be the production ofimage sprites, but I am sure that the creative CSS community will be able to come up with other applications.
I prepared a quick demonstration of this property; if you have a recent night assembly of * Firefox, you can see a little above one Link image , which changes when you hover over it. Anyone looking at a recent nightly assembly will see three static links. (There is no technical possibility to drag the demonstration into Habrahabr, look at theoriginal - approx. Transl.)
__________________
* Although they plan to include image-rect in version 3.6, now this value only works in nightly builds ofFirefox 3.7 (the mozilla-central branch ).
It uses the Mozilla proprietary prefix
foo {background-image: -moz-image-rect (
url (),
, , ,
); }
Here is an example:
.aside {
background-image: -moz-image-rect (
url ('link.png'), 0, 32, 26, 0);
}
The most immediate application of this will be the production of
I prepared a quick demonstration of this property; if you have a recent night assembly of * Firefox, you can see a little above one Link image , which changes when you hover over it. Anyone looking at a recent nightly assembly will see three static links. (There is no technical possibility to drag the demonstration into Habrahabr, look at the
__________________
* Although they plan to include image-rect in version 3.6, now this value only works in nightly builds of