The best CSS clip property Tutorial In 2024, In this tutorial you can learn Examples,Attribute definitions and instructions,Browser Support,Property Value,related articles,
Crop an image:
If the image is larger than the elements it contains, what will happen? -clip attribute allows you to specify an absolute positioning of elements, the size should be visible, the element is cut into this shape, and displayed.
Note :: If prior "overflow: visible", clip property does not work.
Defaults: | auto |
---|---|
inherit: | no |
version: | CSS2 |
JavaScript syntax: | object .style.clip = "rect (0px,50px, 50px, 0px)" |
Figures in the table represent the first browser to support the version number of the property.
属性 | |||||
---|---|---|---|---|---|
clip | 1.0 | 8.0 | 1.0 | 1.0 | 7.0 |
值 | 描述 |
---|---|
shape | 设置元素的形状。唯一合法的形状值是:rect (top,right,bottom,left) |
auto | 默认值。不应用任何剪裁。 |
inherit | 规定应该从父元素继承 clip 属性的值。 |
CSS tutorial: CSS Positioning