Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style clip Property

Style clip Property

Style Object Reference The Style object


Definition and Usage

The clip property sets or returns the visible portion of a positioned element.

Syntax

Set the clip property:

Object.style.clip="auto|rect(

top right bottom left

)|inherit"

Return the clip property:

Object.style.clip

Value Description
auto Default. The element is not clipped.
rect(top right bottom left) The clipped shape is defined by four coordinates.
inherit The value of the clip property is inherited from the parent element.

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the clip property.

**Note:** IE7 and earlier versions do not support the "inherit" value. IE8 supports "inherit" only if a !DOCTYPE is specified. IE9 supports "inherit".


Example

Example

Clip an image to a specified shape:

Runoob Tutorial(runoob.com)

Try it »


Style Object Reference The Style object