style.clip (Property)

A clip region for a style.


CSS level - 2
DOM level - 2
JavaScript - 1.5
JScript - 3.0
Internet Explorer - 4.0
Netscape - 6.0
Property/method value type:String primitive
JavaScript syntax:-myStyle.clip
CSS syntax:clip: aValue
Argument list:aValueEither a rectangle object or a keyword value

Positionable objects can have a clipping region defined for them. This defines the area of the styled object that is visible. At present you can only clip to a rectangular shape. You can specify either a clipping region measured in pixels, or use the symbolic name "auto" to use the extent rectangle surrounding the object as its clip region. The coordinates should be specified in the order: top, right, bottom and left and need to be enclosed in a rect() constructor function to instantiate a rect object to be assigned to the property.

You should be careful not to exceed the extent rectangle of the containing parent element. This should not cause a problem and the clipping regions should be clipped one within the other, but MSIE does not handle this very gracefully sometimes.

If you access the left, right, top and bottom properties of the style.clip rect object individually, you can specify a single numeric value for each as need be.


See also:Clip object, Rect object