Style clip Property

Style Object Reference Style Object


Clip an image into a specified shape:

document.getElementById("myImg").style.clip = "rect(0px 75px 75px 0px)";

Try it yourself »

Definition and Usage

The clip property sets or returns which part of a positioned element is visible.

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The clip property is supported in all major browsers.


Return the clip property:

Set the clip property:"auto|rect(top right bottom left)|initial|inherit"

Property Values

Value Description
auto Default. The element does not clip
rect(top right bottom left) Clips the shape defined by the four coordinates
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit

Technical Details

Default Value: auto
Return Value: A String, representing the part of a positioned element that is visible
CSS Version CSS2

More Examples


Return the clip property:


Try it yourself »

Related Pages

CSS tutorial: CSS Positioning

CSS reference: clip property

Style Object Reference Style Object


Color Picker