The estate clip
is used to crop an absolutely positioned element, serves for cases where an image is inserted inside an element smaller than it, in which case we can use the property clip
to crop the image, adjusting to the size of the parent element, briefly, property defines the area of the widget that will be visible.
Ex:
/*rect(top,right,bottom,left)*/
clip: rect(110px, 160px, 170px, 60px);
Upshot:
img source: css-Tricks clip
Remarks:
According to the MDN the property is obsolete and use the property clip-path
in his stead.
The value default of the property is auto
, that is, it does not limit the display area of the element.
The clip property only works on elements with position:absolute
or position:fixed
. Won’t work with relative
or static
.
For information on compatibility: w3schools css clip
Here is a functional example of the property, defining the visible area of an image, to see the full image just comment on the property clip
.
<!DOCTYPE html>
<html>
<head>
<style>
img {
position: absolute;
clip: rect(20px, 130px, 180px, 30px);
}
</style>
</head>
<body>
<img src="https://pbs.twimg.com/profile_images/1196566139/CRV_-_Urso_comptd.jpg" width="200" height="300">
</body>
</html>
The estate
clip
serves to define the visible area of a fixed element on the page. Applied to an image, it could be compared to an action of Crop. The four values inrect
define the visible area:rect(<top> <right> <bottom> <left>)
. How can this be applied to responsive tables (and use all values 0), I can’t say.– Woss
@Andersoncarloswoss As far as I know it is commonly used in responsiveness to cut large images (usually from the sides) when there is content that can be hidden so as not to have to shrink the image. That is, when decreasing the screen, it is sometimes preferable to cut irrelevant content from the sides instead of decreasing the image.
– Leon Freire
Cool question, particularly unaware of this property.
– Alicia Tairini
The two answers already mentioned that it was obsolete...
– bfavaretto