CSS clip
Property
Topic: CSS3 Properties ReferencePrev|Next
Description
The clip
CSS property defines the clipping region for an absolutely positioned element. However, it does not work if the overflow
property is set to visible
.
The following table summarizes the usages context and the version history of this property.
Default value: | auto |
---|---|
Applies to: | Absolutely positioned elements |
Inherited: | No |
Animatable: | Yes. See animatable properties. |
Version: | CSS 2, 3 |
Warning: Do not use this property as it has been deprecated since CSS3 and removed from the future version. Though some browsers may still support it.
Syntax
The syntax of the property is given with:
The example below shows the clip
property in action.
Example
Try this code »img {
position: absolute;
clip: rect(0px,50px,200px,10px);
}
Property Values
The following table describes the values of this property.
Value | Description |
---|---|
shape |
Clips an element. The only valid shape value is: The top, right, bottom, and left may either have a length value or |
auto |
The element does not clip. This is default value. |
initial |
Sets this property to its default value. |
inherit |
If specified, the associated element takes the computed value of its parent element clip property. |
Browser Compatibility
The clip
property is supported in all major modern browsers.
Basic Support—
|
Further Reading
See tutorial on: CSS Position, CSS Overflow, CSS Display.
Related properties: position
, display
, overflow
, overflow-x
, overflow-y
.