Christoph Paeper <cr***********@gmx.net> wrote:
*Jeff Thies* <no****@nospam.net>:
<img src="test_img.jpg" style="clip: rect(10px 10px 10px 10px)"
alt="alt">
| The 'clip' property applies to elements that have a 'overflow' property
| with a value other than 'visible'.
That's what the CSS 2 specification says, but what the CSS 2.1 draft says,
and what IE 6 has implemented, is this:
"The 'clip' property applies only to absolutely positioned elements."
http://www.w3.org/TR/CSS21/visufx.html#propdef-clip
If you add position:absolute, and maybe some coordinates, you will notice
that the image disappears in a puff of magic. The reason is the odd way in
which the arguments of rect(...) are interpreted: top, right, bottom, left
(the normal CSS order), but so that
- top and bottom are both expressed as displacements from the top of the
element
- right and left are both expressed as displacements from the left of the
element.
To add to the confusion, the CSS 2.1 draft says that "Authors should
separate offset values with commas", but the CSS 2 specification says that
spaces are to be used, and this is what IE expects.
So if you try e.g.
style="position: absolute; clip: rect(10px 50px 50px 10px)"
you should see a clipped image, on supporting browsers.
--
Yucca,
http://www.cs.tut.fi/~jkorpela/